mouse drive control

Hello,

I am trying to “reset” my camera position on an event. However, the mouse drive is interfering.

The manual says you have to disable the drive to move the mouse under show control.

panda3d.org/manual/index.php/T … era_Driver

However, when I re-enable it, the camera goes back to where it was last time. I see a flicker at the coordinates I want followed by returning to the old ones apparently.

	base.disableMouse()
	base.camera.setPos( 0, 0, 0 )
	base.cam.setPos( top.viz.getX( ), -ydist, 0 )
	base.enableMouse()

For the record, I don’t recommend fiddling with the position of base.cam directly; the purpose of base.camera is to be the place that receives the camera’s transform.

If you want to adjust the camera position as controlled by the default trackball controls, just use:

base.trackball.node().setPos(x, y, z)

This doesn’t move the trackball node; what it does is call Trackball.setPos(), a special method that changes the “current position” of the thing the trackball is controlling, which is the camera.

David

Deleted.

I found that this method had an inverted effect. When I set position ( 0, 50, 0 ), then printed base.camera position, I got ( 0, -50, 0 ).