• Advertisement
Sign in to follow this  

Getting world space position from mesh space position

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

I'm loading .x file hierarchy, so I have different frames, when the mesh is moving I want to get the position of the eyes, so I added a sphere exactly infront of the eyes in the 3D modeling software, and trying to get the WORLD position for that sphere instead of the mesh position.

I'm using the following code and getting the same position no matter where the model move:

D3DXVECTOR3 GetEyesPosition()
{
D3DXFRAME_EXTENDED* frame = (D3DXFRAME_EXTENDED*)D3DXFrameFind(m_frameRoot, "eyesSphere");
return D3DXVECTOR3(frame->TransformationMatrix._41, frame->TransformationMatrix._42, frame->TransformationMatrix._43);
}



How do I calculate the frame world space position?

Share this post


Link to post
Share on other sites
Advertisement
Resolved after multiplying the world space matrix with the mesh space matrix, can anyone tell me if I'm setting up the vision correctly?

Share this post


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

  • Advertisement