• Advertisement
Sign in to follow this  

Mesh Coordinates

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

Hi, I have some problems about mesh coordinates and rotating it. First i set the coordinates(D3DXMatrixTranslation -400, 1, 200) after that i try to rotate the mesh with(D3DXMatrixRotationX).It's ok until now but mesh rotates around the origin(0, 0, 0).I want the rotation around mesh's origin (-400, 1, 200).

D3DXMATRIX matXRotation, matYRotation, matZRotation, matCoordinate,  matWorld;


D3DXMatrixTranslation( &matCoordinate, -400, 1, 200 );


D3DXMatrixRotationX( &matXRotation, m_XRotation);


D3DXMatrixRotationY( &matYRotation, m_YRotation);


D3DXMatrixRotationZ( &matZRotation, m_ZRotation);


D3DXMatrixMultiply(&matWorld, &matXRotation, &matYRotation); 


D3DXMatrixMultiply(&matWorld, &matZRotation, &matWorld); 


D3DXMatrixMultiply(&g_mCenterWorld[nObjectnum], &matCoordinate, &matWorld);



What am i going to do for fixing the problem?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You should rotate first and translate afterwards, I guess...

Share this post


Link to post
Share on other sites
If i rotate first and than translate.
Mesh goes to point of origin (0, 0, 0) not coordinates which i gave (-400, 1, 200).

Share this post


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

  • Advertisement