Terrain reading note: Chapter 2

xiaoxiao2021-03-06  45

Chapter 2. Fundamental 3D Objects

This chapter is primarily .x file and .fx files, as well as a very complex skeletal animation and skin network in my opinion. This chapter has many interfaces and structures that have never seen it in the book for the for Beginner. For the book of For Beginner! (Can't watch ...)

Load & Display a Model Using D3DX

Display 3 basic elements required for 3D objects:

1) Model itself (geometric information) 2) Material (color tone reflected from object surface) 3) Above the surface of the object (optional)

Show mesh trilum:

1) Read the mesh2 from the disk) Build the objects3 required to render the Mesh) Use these objects to display the contents of Mesh

Mesh is divided into many subsets when rendering, Subset is a collection of geometry using the same matial. Effect Files

FX Files can be written to Vectex Shader and Pixel Shader, or Write Fix-Function Pipeline. I also thought FX could only write VS and PS.

This piece is not deep, it is estimated that it will be in the case of chapter 3, when you talk about HLSL.

D3DXFrame & D3DXMESHCONTAINER

These two haven't heard it before ... especially D3DXFrame, the data structure used is actually a "brother-son" binary tree to represent the hierarchy of the forklore. From the definition of D3DXMeshcontainer, the DS it uses is LINK LIST. I really want to thank my own book of Data Structure (although these two DS are more idiot -_- |||).

D3DXFrame and D3DXMeshcontainer are primarily used to organize large-scale Mesh. Frame is a fork tree (expressed with a binary tree), and there is a transform matrix in each Frame. Meshcontainer is a linked list on each node fork a fork tree, which is used to store the Mesh in this Frame. A pile of a pile of a pile of a pile ... No wonder liker said that this is complex, it is complicated.

But listening to Snow, D3DX can get them in one time, with D3DXLoadmeshhierarchyfromx, it is really thoughtful. This thing is handmade a one and not read it.

In addition, Meshcontainer can not only store ordinary Mesh, and can store Progressive Mesh and Patch Mesh. This is due to D3DXMeshdata.

The book says that you want to create Skinned Mesh, you need to create D3DXFrame first, then create D3DXMeshcontainer, and finally ID3DXSKINIINFO. Oh? Is this a shrimp? The explanation on the book is a bit dizzy, check the check MSDN:

ID3DXSkinInfo InterfaceApplications use the methods of the ID3DXSkinInfo interface to manipulate bone matrices, which are used to skin vertex data for animation. This interface is no longer strictly tied to ID3DXMesh and can be used to skin any set of vertex data.

Oh, it seems to be used to operate BONES. SkeleTal Animation & Skinned Meshs

This section has more complicated things (I thought that the Frame is already complicated). An ID3dxanimationset contains a table of ID3DxanimationController. Each ID3DxanimationController is connected to a Frame of the same name, such as "left hand", "right foot". Then manipulating the Controller can be able to manipulate this part.

This chapter has almost no code, which is to describe the relationship between several structures and interfaces in words. Although it is generally understood, it is not enough to understand, it seems to wait until it will have a deep layer. Understand.

转载请注明原文地址:https://www.9cbs.com/read-47673.html

New Post(0)