TAILIEUCHUNG - Advanced 3D Game Programming with DirectX - phần 4

Sau khi bạn có được con trỏ giao diện, bước tiếp theo là tuyên bố hợp tác xã như thế nào bạn có ý định trên đang được. Cũng giống như DirectInput, điều này được thực hiện lpcGuid Một con trỏ đến một GUID mô tả thiết bị mà bạn muốn tạo thường chỉ có một card âm thanh trên máy tính. Để có được các thiết bị mặc định | Now that know how to represent all of the transformations with matrices you can concatenate them together saving a load of time and space. This also changes the way you might think about transformations. Each object defines all of its points with respect to a local coordinate system with the origin representing the center of rotation for the object. Each object also has a matrix which transforms the points from the local origin to some location in the world. When the object is moved the matrix can be manipulated to move the points to a different location in the world. To understand what is going on here you need to modify the way you perceive matrix transformations. Rather than translate or rotate they actually become maps from one coordinate space to another. The object is defined in one coordinate space which is generally called the object s local coordinate space and the object s matrix maps all of the points to a new location in another coordinate space which is generally the coordinate space for the entire world generally called the world coordinate space . A nice feature of matrices is that it s easy to see where the matrix that transforms from object space to world space is sitting in the world. If you look at the data the right way you can actually see where the object axes get mapped into the world space. Consider four vectors called n o a and p. The p vector represents the location of the object coordinate space with relation to the world origin. The n o and a vectors represent the orientation of the i j and k vectors respectively. Figure The n o a and p vectors for a transformation You can get and set these vectors right in the matrix as they are sitting there in plain sight n nr n 0 O o o 0 a ar a 0 p pr p. 1 214 This system of matrix concatenations is how almost all 3D applications perform their transformations. There are four spaces that points can live in object space world space and two new spaces view space and screen space. View space defines

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.