[ODE] Camera movement?

Megan Fox shalinor at gmail.com
Tue Mar 14 16:24:24 MST 2006


I do this as well, and it works great for a rigid cam.

If the original poster wants to take this and turn it into a "sloppy"
cam, all you've really got to do is take that "most valid camera
point" that we hard-set as the camera point, and just put that as your
camera AI's destination point.  You could also keep a spherical body
that you test the discovered position with, to see if the position has
room for your full (now physical) camera, separate from the body you
use on your actual moving-around-the-world camera.

>From there, just treat your camera as a small, flying, physical entity
represented by a sphere.  The AI is responsible for getting to the
desired point, or barring that, finding a solution to the problem
(probably something to the effect of "if out of desired position for X
period of time with distance greater than Y amount, pop to desired
position), you'll just have to make sure the movement is desirable and
not sickness inducing.

> 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
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>


--
-Megan Fox
http://shalinor.circustent.us/megan/resume/



More information about the ODE mailing list