From: Stephan Maximilian Huber <[EMAIL PROTECTED]>
Hmm. I did similar things in a project (capture part of the scene into a different sized image with even more decoration). My steps: 1. create a new cameranode, and configure it 2. add the part of the scene I want to render into an image to a group 3. add that group to the cameranode 4. add the cameranode to the root-scene 5. call osg's renderloop 6. get the image from the cameranode, remove cameranode from root-scene
this worked for me without a hitch. Perhaps you have to configure your new cameranode manually, without copying from your existing camera.
Yeah, ultimately, I might want to modify my print output so it is a little bit different than the regular view. So I tried not copying the camera as you suggested and setting up the attributes separately. This worked with one item that I don't understand. Maybe somebody can explain this. I copied the root_camera options one by one to my new camera. But it turns out that I have to use a different setting for setReferenceFrame(). I must set it to use osg::Transform::ABSOLUTE_RF. (The simpleViewer camera is default set to RELATIVE_RF.) If I don't set this value, I continue to get my plain blue screen. (I suspect the camera is looking in the wrong direction.) So what's going on here and why are these values not the same? Here's the code snippet for reference. osg::Camera* root_camera = simpleViewer->getCamera(); osg::Camera* the_camera = new osg::Camera; the_camera->setClearColor(root_camera->getClearColor()); the_camera->setClearMask(root_camera->getClearMask()); the_camera->setProjectionMatrix(root_camera->getProjectionMatrix()); the_camera->setReferenceFrame(osg::Transform::ABSOLUTE_RF); // the_camera->setReferenceFrame(root_camera->getReferenceFrame()); the_camera->setViewMatrix(root_camera->getViewMatrix()); the_camera->setViewport(root_camera->getViewport()); Thanks, Eric _______________________________________________ osg-users mailing list [email protected] http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
