Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forward and left vectors

Status
Not open for further replies.

tokaplan

Programmer
Jan 20, 2004
1
RU
For example, I have a spaceship 3D model. I can calculate the matrix of its orientation:

D3DXMatrixIdentity( &RotMat );
D3DXMatrixRotationX(&RotMat, Angles.x );
D3DXMatrixMultiply(&matWorld, &RotMat, &matWorld);

D3DXMatrixIdentity( &RotMat );
D3DXMatrixRotationY(&RotMat, Angles.y );
D3DXMatrixMultiply(&matWorld, &RotMat, &matWorld);

D3DXMatrixIdentity( &RotMat );
D3DXMatrixRotationZ(&RotMat, Angles.z );
D3DXMatrixMultiply(&matWorld, &RotMat, &matWorld);

D3DXMatrixTranslation( &matTrans, Point.x, Point.y, Point.z );
D3DXMatrixMultiply( &matWorld, &matWorld,& matTrans );

m_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld);

Now, having the matWorld matrix (it completely defines plane's orientation, doesn't it?), I need to extract "forward" and "left" vectors for my plane from it. How can it be done?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top