Trailing camera

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!

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

many thanx - probably posted that in the wrong section - really a beginners problem i suppose. I always struggle with views for some reason