TAILIEUCHUNG - Character Animation with Direct3D- P5

Character Animation with Direct3D- P5:This book is primarily aimed at teaching indie and hobby game developers how to create character animation with Direct3D. Also, the seasoned professional game developer may find some interesting things in this book. You will need a solid understanding of the C++ programming language as well as general object-oriented programming skills. | 66 Character Animation with Direct3D set up bone transforms int numBones boneMesh- pSkinInfo- GetNumBones for int i 0 i numBones i D3DXMatrixMultiply boneMesh- currentBoneMatrices i boneMesh- boneOffsetMatrices i boneMesh- boneMatrixPtrs i Set HW Matrix Palette D3DXMATRIX view proj pEffect- SetMatrixArray MatrixPalette boneMesh- currentBoneMatrices boneMesh- pSkinInfo- GetNumBones Render the mesh for int i 0 i boneMesh- NumAttributeGroups i int mtrl boneMesh- attributeTable i .AttribId pEffect- SetTexture texDiffuse boneMesh- textures mtrl D3DXHANDLE hTech pEffect- GetTechniqueByName Skinning pEffect- SetTechnique hTech pEffect- Begin NULL NULL pEffect- BeginPass 0 boneMesh- DrawSubset mtrl pEffect- EndPass pEffect- End if bone- pFrameSibling NULL Render Bone bone- pFrameSibling if bone- pFrameFirstChild NULL Render Bone bone- pFrameFirstChild lease purchase PDF Split-Merge on to remove this watermark. Chapter 3 Skinned Meshes 67 Not much has changed in this function compared to the software skinning example. Most notable of course is the use of the shader and uploading the Matrix Palette to it. Otherwise you loop through the different attribute groups of the mesh and render it using the shader. Rendering Static Meshes in Bone Hierarchies Sometimes you might not want the character skinned. Making animated machinery is a prime example. Machinery rarely has soft parts thus you don t really need to skin a mesh to make mechanical creations in your games. Nonetheless you might want to have a bone hierarchy controlling the different parts of the machine. Take the example of a robot arm as shown in Figure . sase purchase PDF Split-Merge on to remove this watermark. 68 Character Animation with Direct3D FIGURE As you can see each part of the robot arm is rigid and therefore does not require skinning. Another case where you need rigid solid objects is when they are combined with skinned meshes. In the previous examples .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.