Skip to main content
gamedev.net
🔒 Locked

Camera

Started by Apouche Apr 29, 2003 at 4:45 PM 0 replies 900+ views
Original Post
Apouche
Apouche
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...
Enselic
Enselic
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]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.