Jump to content
  • Advertisement
Sign in to follow this  
xujiezhige

Your methods of traversing the vertex buffer of a unknown mesh ( DirectX)

This topic is 2500 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

If you get a pointer to a unknown mesh, how do you tarverse the vertex buffer?

like:
HRESULT Func( LPD3DXMESH pMesh )
{
[color=#ff0000]VERTEX* p = NULL;
pMesh->LockVertexBuffer( 0, &p );
.....
}

How do you define the [color=#ff0000]VERTEX mentioned above?

Share this post


Link to post
Share on other sites
Advertisement

How do you define the [color=#ff0000]VERTEX mentioned above?


You can't. What you can do is get the array of vertex elements with GetDeclaration, and use that to determine the stride of the vertices as well as the offset of any particular element within a single vertex.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!