Archived

This topic is now archived and is closed to further replies.

Apouche

Camera

Recommended Posts

I use Direct3D and, in fact here is what I want to do. I have a ship that moves in the 3D space and I want my Third person Camera to always follow it. How can I do that ? I use the D3DXLookAtLH function but it doesn''t really work because my camera don''t use with it. Furthermore, when for example my ship turn left (a Yaw angle not a Roll) I still want my camera to be behind it. Don''t forget that it is a third person camera so there is a distance separating the ship and the camera. Thanks...

Share this post


Link to post
Share on other sites
I've never actually implemented an 3rd-person camera myself, but if you want a really simple one, and if you have the direction vector of the ship, you could just set the camera position at the point vShipDirection * -X and and the the "look-at" point to vShipPosition where X is a number that suits your scale. If you want a smooth moving camera with interpolation and stuff I think you should look into quoternions. But as I've said, I've never implemented a 3rd-person camera myself.


____________________ ____ ___ __ _
Enselic's Corner - CodeSampler.com

[edited by - Enselic on April 29, 2003 6:09:35 PM]

Share this post


Link to post
Share on other sites