set pos/hpr on camera

Hey,

Another n00b question.
How to set the pos and hpr of the camera in c++?
I tried:
camera.set_pos
window->get_camera().set_pos
base.camera.set_pos

but none of them work.

Once you have set up the trackball, you are no longer in control of the camera’s position–the trackball controls are. It’s just like base.enableMouse() in Python.

Try commenting out the call to window->setup_trackball().

David

sry, still doesn’t work.
my code:

framework.open_framework(argc, argv);
framework.set_window_title("My Panda3D Window");
WindowFramework *window = framework.open_window();
Camera *cam=window->get_camera(0);
cam.set_hpr(5.0, 2, 6);
cam.set_hpr(6.0, 0, 0);

the error:

ppview.cxx: In function ‘int main(int, char**)’:
ppview.cxx:28: error: request for member ‘set_pos’ in ‘cam’, which is of non-class type ‘Camera*’
ppview.cxx:29: error: request for member ‘set_hpr’ in ‘cam’, which is of non-class type ‘Camera*’

If you have a Camera* (pointer and not instance), perhaps cam->set_hpr( ) and cam->set_pos( ) works?

ppview.cxx: In function ‘int main(int, char**)’:
ppview.cxx:28: error: ‘class Camera’ has no member named ‘set_pos’
ppview.cxx:29: error: ‘class Camera’ has no member named ‘set_hpr’

I guess I need the NodePath of the Camera. but how?

OK, I looked at some of the source files, and I found this:
NodePath cam = window->get_camera_group();
That works fine for me.
Thanks for all your help!