[ODE] Third Person Orbit Camera

Jon Watte (ODE) hplus-ode at mindcontrol.org
Mon Aug 28 10:56:18 MST 2006



Anton Bursch wrote:
> What I'm thinking that I'm going to do is move the player with ODE and then follow the player with
> the camera in my own code, but I need to make sure the camera doesn't go thru walls and stuff so I
> am thinking that I'll go ahead and move my camera with the player and then cast a ray from the
> player to the camera desired position and if there is something between, i zoom in the camera.
>   

That's similar to what the player/camera interaction looks like in 
http://www.mindcontrol.org/~hplus/raycar/

It's not perfect, but it works.

An alternative would be to always put the camera behind the player. Cast 
a ray in the reverse direction of the player look direction, and place 
the camera wherever that ray hits some geometry, or at a fixed distance 
out; whichever is smaller. This gets a much more direct feel. You may 
want to fade out the player as the camera gets really close, though, to 
avoid clipping through their head.

Cheers,

             / h+



More information about the ODE mailing list