moving the camer in direction of heading (using interval)


I’m new to Panda3d, I know this must be a basic question. I’m moving the camera with hprInterval and posInterval. The problem I’m having is that I want the camera to move in the direction of its heading (like a first person’s view point).

Here are two images to illustrate what it is doing and what I want it to do.

Thank you.

You can achieve this effect by getting the matrix of the object, then use the right row as vector.
The roaming ralph example in your panda3d samples dir does that. Take a look at it.

Another way wold be to tell Panda3D to move the camera NodePath relative to itself, for example for moving forwards (+y axis):

np.setPos( np, 0, speed * dt, 0 )


An enn0x, that is a very good idea. I haven’t thought of that before. Thank you very much!