Camera angles and handling

Blitz3D Forums/Blitz3D Programming/Camera angles and handling

Nate the Great(Posted 2008) [#1]
Does anyone know how to handle camera angles in a car game. I like the way polymaniacs does it but I can't seem to get my cameras to look normal or do anything that even looks remotely acceptable for a game.

I am just asking about the concepts but any code is also welcome.


mtnhome3d(Posted 2008) [#2]
you could tform the camera to the "car" and set ti up that way, i have some way simple code somewhere. let me dig it up.

[edit] i dug it up and here it is

For c.char=Each char
TFormPoint 0,30,-70,c\e,0
PointEntity cam,c\e

just replace the type with you own, this is the basic version, you could add code to check for collision and if none then tformpoint.


Stevie G(Posted 2008) [#3]
There's a smart-cam in the code archives and an example of a chase camera in both the driver and castle demo's.

The Polymaniacs camera's are a combination of orbital ( GTA ) and chase. It's designed to give the best view if something is obscuring the camera's view of your vehicle. For each camera there is an offset vector which the camera is trying to get to and a target vector which the camera points to. I also set the speed that the camera chases the target point differently on all 3 axis' relative to the direction the vehicle is travelling. Sorry, can't provide code at this time.