Initial camera position

Hey,

im trying to set the camera into an initial position in python. The problem here seems to be, that the mouse has to be disabled to do so. But i want to enable the mouse with the initial camera position set, but as soon as I call ShowBase.enableMouse() the camera snaps back to origin.

You can save the position of the camera in shut-off time, and move after shutdown.

I recall there’s a way you can copy the camera position to the default camera controller that I can dig up, but note that disableMouse is a misnomer; it doesn’t actually disable the mouse, but it disables the default mouse-controlled camera controller. Just to verify, you are asking about enabling this camera controller and not just about enabling the mouse in general?

@rdb I want to set the Camera at a good Position to view my scene on the startup and then still have the access to the standard mouse controls (pan, zoom, rotate)

@serega-kkz I dont really understand what that means, could you elaborate it in more detail, please?

example:

base.trackball.node().set_pos(0, -33, 0)
base.trackball.node().set_p(33)

But it is better to write your camera controller.

Perfect, that is exactly what i was Looking for. For my program this will be sufficient, since the User will be only rotating around the origin anyhow. Maybe im going to add my own camera Control later on but for now its not planned.
Thank you