Jump to content
  • Advertisement
Sign in to follow this  
CodeBoyCjy

Problem with getting adjacency data of the mesh

This topic is 3879 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hey I try to get the adjacency data of the mesh, but there is some problem get me confused. First , I load the mesh from file by the function "D3DXLoadMeshFromX" , and it worked. And I get the vertex buffer rightly too , but when I try to get the adjacency data of the mesh , I'm confused. In the doc of the SDK , D3DXLoadMeshFromX Function -> ppAdjacency(one paramenter of the function) , here is the explanation of the paramenter ([out] Pointer to a buffer that contains adjacency data. The adjacency data contains an array of three DWORDs per face that specify the three neighbors for each face in the mesh.) The thing confused me is that how does the "DWORD"s contains the adjacency data.What make me more confused is that , the number of the adjacency data is three times of the number of faces of the mesh. So I sense that the adjacency data is the index of the vertexbuffer data , and each three in one group stands for a single face , So I tried to testify it , but it seems not true. So I realy don't know how the adjacency data contain the information , I just get the an array of "DWORD"s , I'll be really appreciate if someone help, this is really important to me.

Share this post


Link to post
Share on other sites
Advertisement
Each face in the mesh is a triangle, therefore each face has three faces that are adjacent to it. Each DWORD is an index that identifies a particular face in the mesh, with 0 being the triangle composed of the first 3 values in the index buffer and so on.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!