View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Rotating mesh till it look at another mesh

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

21 replies to this topic

### #21ankhd  Members

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).

### #22Medo3337  Members

Posted 17 May 2012 - 11:03 AM

I am not sure what you mean, but I think my 3D world is working right, here is what happens:

Camera position:
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.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.