Archived

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

henryx

camera control in car game

Recommended Posts

Hi, I''m looking for some ideas on controlling a third person camera in an F1 type racing game that I am currently working on. I have a number of possible camera views, but in the one I am currently working on, I have the camera position behined the car looking over the car and onto the road in front of the car. This is great and works well when the car is on a straight bit of road, but the problems arise when the car comes to a corner. I have tried a few things such as swinging the camera round behined the car as it travels round the corner - this seems resonable but does lead to lots of camera code. Basically, my question is this - does anybody know of any cool methods/algorithms for controling the movement of the camera in this type of game. There must be lots of good methods out there since there are many racing games such as f1 2000 etc which have really good camera control. Any good ideas appreciated. thanks henry

Share this post


Link to post
Share on other sites
Consider putting the camera on a spring. Game programming gems has (as usual) a good description (and a demo) of this. (at least I THINK it was GPG)

Edited by - meZmo on November 13, 2001 1:10:42 PM

Share this post


Link to post
Share on other sites
That spring effect you were talking about is realy just a simple line of code.

Plug this in to your camera code:

CameraPos += ((CarPos - CameraPos) / 16.0f);

Play with 16.0f to ge some differect effects.

Share this post


Link to post
Share on other sites