Window->setup_trackball()


#1

It seems that the camera.set_pos() won’t work if I use window->setup_trackball() to control the camera with mouse.

So can I use camera.set_pos() normally when using window->setup_trackball() together?

Thanks in advance


#2

is there any way to set the origin position of camera while using setup_trackball()?
Please help


#3

You can apply the position to the Trackball interface directly.

NodePath trackball_path = window->get_mouse().find("trackball");
PT(Trackball) trackball = DCAST(Trackball, trackball_path.node());
trackball->set_pos(0, 0, 0);
trackball->set_hpr(0, 0, 0);
trackball->move_origin(0, 0, 0);

Or you could instead parent the camera to another node and position that around instead.