[ODE] Camera movement?

Shamyl Zakariya shamyl at zakariya.net
Tue Mar 14 15:42:22 MST 2006


I wanted a similar effect for a "chase car" camera a while back. What  
I did was to have a ray projecting backwards and up from the car, for  
which I tracked collisions against scene geometry. If the ray didn't  
collide with anything, I just placed the camera at the endpoint  
( say, 20m ); however if the ray did collide, I placed the camera at  
the closest point on the ray without a collision. I had the camera  
then look at a point in front of the car.

I used a simple ( non ODE ) spring system to smooth the camera  
position and look target so I wouldn't have jerky transitions. It  
worked pretty well, allowing for a nice "sloppiness".


shamyl zakariya
     "all humans are vermin, in the eyes of morbo"
         -- morbo

On Mar 12, 2006, at 10:46 PM, Jean-Sebastien Guay wrote:

> Hello again,
>
> As mentioned in another message, I'm working on a submarine arcade  
> type game.
> It's using a third-person camera which I would like to follow the  
> player's sub
> kind of in a "sloppy" way, meaning that it always follows it but  
> that if the
> sub turns too sharply it has a hard time keeping up and then comes  
> back on line
> with it after a short moment. I would also have to take care of  
> collision
> detection for the camera since an object could lie where the camera  
> should be.
>
> I thought of using a ball joint for the motion, attached to the  
> camera and the
> submarine, and then giving the camera a small sphere geom for  
> collision
> detection. But I wonder if a joint (ball or any other type) can  
> leave space
> between the two bodies, or if they have to be physically touching?  
> I would need
> to keep a more or less constant distance between the two bodies to  
> be able to
> see around the sub.
>
> What I thought of doing is to create two "virtual" bodies that  
> would represent
> axes that come out of the objects (behind the sub and in front of  
> the camera)
> and attach those with the joint. These bodies would just never be  
> shown.
>
> In the end, would something like that work? Or can you suggest  
> another way?
>
> Thanks,
>
> J-S
> --
> ______________________________________________________
> Jean-Sebastien Guay     jean-sebastien.guay at polymtl.ca
>                          http://whitestar02.webhop.org
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode



More information about the ODE mailing list