About camera: auto-generating path?

I want to have some cut-scene movies in my game, and during the movies, the camera will move as some existing games did. The problem is: Is there any function to help me to auto-move the camera if I just provide the starting position and ending position? (Just something like 3Dmax can do) Or I must write an equation to handle the camera movement? It looks troublesome.
Thanks all!

Hello,

I am not sure but I guess there is no such function. In order to simulate that behaviour you can try two things:
  • Use motion paths. To define a motion path using a modeler, which much be able to export to an egg file, load the motion path and create a motion path interval.
    I suppose you can tie the camera to the motion path but I have not tested it.
    In this case, I do not think you will be able to modify the camera attributes.

  • Use interpolation intervals.

i = LerpPosInterval(model, duration, pos, startPos = None,
other = None, blendType = ‘noBlend’,
bakeInStart = 1, fluid = 0, name = None)

You create the path by hand. For example, define segments in the space (start, stop) and use a sequence of intervals. For each point of the interval
you can call a function that might change the orientation and position of
the camera.

So, I think you must define your path as a set of segment and for each segment use ‘LerpFunc’ for modifying the camera attributes.

In any case, check the manual for further information.

Alberto

For a simple interpolation motion like you’ve described, the Lerp (linear interpolation) functions should be exactly what you need. Check this section of the Panda3d manual for more information:

http://www.panda3d.org/manual/index.php/Lerp_Intervals

You’ll most likely want a PosHpr interval; triggering this animation moves the camera from its current location to the position and rotation (heading, pitch, roll) specified in the interval.

To the best of my knowledge, there isn’t currently any sort of GUI interface for building the animation in Panda3d; to figure out what position and rotation you want, you’ll need to position the camera (using either the setPos and setHpr commands or camera.place() ) and then write down the current camera position (using getPos and getHpr).

Best of luck!

-Mark