Sign in to follow this  

Mesh Coordinates

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this