Rotating mesh till it look at another mesh,
Members - Reputation: 2253
Posted 15 May 2012 - 09:21 PM
first take all rotations from the tank, place some markers in the +x and + z and +y within your own 3d world, load your tank see what direction its pointing.
And yes its working in my code, my unit faces the target.(my world plane is x z, y up) if your worlds coord not match change the x,z, y params around(and thats enough guessing for me).
Members - Reputation: 891
Posted 17 May 2012 - 11:03 AM
m_vEyePt = D3DXVECTOR3(0.0f, 0.0f, 1.0f);
m_vLookAtPt = D3DXVECTOR3(0.0f, 0.0f, 0.0f);
m_vUp = D3DXVECTOR3(0.0f, 1.0f, 0.0f);
m_vRight = D3DXVECTOR3(0.0f, 1.0f, 0.0f);
X, Y and Z:
Y+ move the mesh up towards the sky
Y- move the mesh down towards the ground
X+ move the mesh to the left
X- move the mesh to the right
Z+ move the mesh to back
Z- move the mesh to front
Of course if I moved the camera position the above will not be the same.