Jump to content
  • Advertisement
Sign in to follow this  
bengaltgrs

Vertex Position

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

Would it be possible to somehow find the position of a particular vertex of a mesh after a position and rotation have already been applied to the mesh? For example, assume you have applied and world rotation and position to some mesh and wanted to find the position of vertex 6 and 7 of the mesh, perhaps by locking the vertex buffer and finding it? I am not exactly sure how to go about doing this. -Chris

Share this post


Link to post
Share on other sites
Advertisement
What you need is the pretransformed vertex position (this is stored in the VB, you can simply lock it and get it from there) and the transformation matrix (the world matrix, or maybe the full transformation matrix to find the screen coords).

Then, what you do is simulate the gpu transformation proccess in the cpu. The easiest way to do so would be using D3DXVec3TransformCoord. Transforming the vertex position by the world matrix would provide the world position of the vertex.

Good luck :).

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!