PDA

View Full Version : Trailing camera



onepint
07-02-2005, 06:55 AM
I am writing a driving game, but cant make the 'camera' work. Can somebody tell me how
to create a 'trailing' camera view. I've tried storing the cars position in an array then use that in glulookat, but the view just swingsabout all over the place!

Mikkel Gjoel
07-02-2005, 09:05 AM
How about


camera.interest = car.pos;
camera.position = car.pos + distance*(global.up-car.current_drive_direction);- assuming up and car.direction are normalized. This would result in a locked view - you probably want a smoother result, but I guess it'll get you started.

\\hornet

onepint
07-02-2005, 11:06 PM
many thanx - probably posted that in the wrong section - really a beginners problem i suppose. I always struggle with views for some reason