Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Getting world space position from mesh space position


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 Medo3337   Members   -  Reputation: 680

Like
0Likes
Like

Posted 25 November 2012 - 12:06 AM

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?

Sponsor:

#2 Medo3337   Members   -  Reputation: 680

Like
0Likes
Like

Posted 25 November 2012 - 12:56 AM

Resolved after multiplying the world space matrix with the mesh space matrix, can anyone tell me if I'm setting up the vision correctly?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS