[ODE] Player camera

Jon Watte hplus-ode at mindcontrol.org
Tue Sep 14 14:57:45 MST 2004


http://www.mindcontrol.org/~hplus/graphics/camera-description.html

Also, http://www.speakeasy.net/~hplus/carworld-040730.zip contains an 
implementation of a camera that's somewhat like that, except slightly 
less fancy. It has no bouncing I'm aware of.

The trick is in the simple integration based on predicted forward position:

  positionSoon = curPosition + curVelocity * lookForwardDelta;
  desiredPosition = do_your_magic_here();
  dBodyAddForce( cameraBody, (desiredPosition - positionSoon) * SCALE );

Larger lookForwardDelta makes the response heavier. Larger SCALE makes 
the response snappier.

The other tricks involve no gravity on the camera, and not letting the 
camera affect other objects (so, when camera is involved, always create 
contacts between camera and NULL).

Also, if you're behind some collision and can't see the player for more 
than a short period of time, you probably should cut the camera (as 
explained in the article).

Cheers,

			/ h+



-----Original Message-----
From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of
Pierre Renaux
Sent: Tuesday, September 14, 2004 11:10 AM
To: ode at q12.org
Subject: [ODE] Player camera



Hello,

I'm trying to find informations to make a simple Quake type sliding player
camera using ODE.

I tried to google and look through the mail archive, and I cant find any
relevant infos.

The main problem I have is that I cant really get rid of the bouncing.

Otherwise my system works pretty well, with boxes, and trimeshes bouncing
properly :P

Now I just need this simple sliding camera to work.

Thanks,
- Pierre

_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode




More information about the ODE mailing list