Original Post
Hello all,
Im writing a small car demo
and im having trouble getting the wheels to
rotate correctly.
I am able to rotate the wheels so they turn round as
the car moves.
I am able to turn the wheels left and right
The problem is that when i do them together, the rotations are applied at the same time and the wheels wobble all over the place!
what i want is to apply the roll then apply the yaw
so the wheel spins as it is turned left or right.
any help would be great below is the code im using
wYaw+=0.005;
wRoll+= 0.005;
D3DXMatrixRotationX(&wRotX, wPitch);
D3DXMatrixRotationY(&wRotY, wYaw);
D3DXMatrixRotationZ(&wRotZ, wRoll);
D3DXMatrixMultiply(&wRotTemp, &wRotZ, &wRotTemp);
D3DXMatrixMultiply(&wRotTemp, &wRotX, &wRotY);
D3DXMatrixMultiply(&wTrans, &wRotTemp, &wTrans);