Yaw,Pitch,Roll, Translation matrix

Started by
6 comments, last by EagleWarrior 22 years, 1 month ago
Im using Directx to Move my Object and i have a problem my objects rotates Weird. Does it differ which Matrix i multiply first? MatoWorld=MatWorld*Translation MatWorld=MatWorld*MatPitch MatWorld=MatWorld*MatYaw MatWorld=MatWorld*MatRoll in this order only the Roll and Translation work fine but the other 2 end up rotating on the World Axis not the Axis i made I traced my axis Vecotors to see if the where moving with the object and they where. I tryed changing the order i multiply and tracing MatWorld i end up with diff matrices for each. They Supposed to be Equal but they aint. anyways thxs
Advertisement
The order matters

Try Yaw, Pitch, Roll, Translation
didnt make a diff now the YAw works good but the rest dont
Roll, Yaw, Pitch, Translate.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

[if you have a link proposal, email me.]

EDITed for a nasty lil' error

[edited by - zealouselixir on March 19, 2002 11:30:30 PM]

[twitter]warrenm[/twitter]

lol that didnt work either
heres my code


D3DXMATRIX matWorld,matTran;
D3DXMatrixTranslation(&matTran, m_oFighter.vPos.x, m_oFighter.vPos.y, m_oFighter.vPos.z);
D3DXMatrixMultiply( &matWorld, &matRoll, &matWorld );
D3DXMatrixMultiply( &matWorld, &matPitch, &matWorld );
D3DXMatrixMultiply( &matWorld, &matYaw, &matWorld );

matWorld=matWorld*matTran;
Use this function to make your rotation matrix, instead of making a Yaw, pitch, and roll and then multiplying.

D3DXMatrixRotationYawPitchRoll

Domini
Rastagon 2 Engine
Looks like you never setup the matWorld matrix before you start using it...I''m guessing you setup the yaw/roll/pitch right too..



D3DXMATRIX matWorld,matTran;

D3DXMatrixIdentity (&matWorld);
D3DXMatrixTranslation(&matTran, m_oFighter.vPos.x, m_oFighter.vPos.y, m_oFighter.vPos.z);
D3DXMatrixMultiply( &matWorld, &matRoll, &matWorld );
D3DXMatrixMultiply( &matWorld, &matPitch, &matWorld );
D3DXMatrixMultiply( &matWorld, &matYaw, &matWorld );
D3DXMatrixMultiply( &matWorld, &matTran, &matWorld );
i fixed my problem i initilaized the local axis in the Frame Move function instead of the OneTimeInit so it kept changing the axis to its first coordinates. talk about dumb lol

This topic is closed to new replies.

Advertisement