Robert Osfield schrieb:
Hi Andreas,
On 4/3/07, Andreas Goebel <[EMAIL PROTECTED]> wrote:
I´m using an osg::camera to take a screenshot in high-res.
To have it as easy as possible, I just copy the original
scene-View-camera. See code below.
Just one problem and one question:
- after taking the picture, my viewport is set to the 2500 pixels. Why
is the original camera modified? Shouldn´t i use the copy-constructor
here?
- is there a way to figure out the maximum-resolution I can use for a
screenshot?
Really not sure what is going on because your using the OSG in a bit
of odd way. SceneView itself has its osg::Camera which can be
accessed via SceneVIew::getCamera()
& setCamera(..), whereas you are creating your own camera and
assigning as a scene graph via setSceneData() - this ends up with two
Camera's which could certainly lead SceneView to some confusion.
The better way would be to take your RTT camera and assigned it
directly to the SceneView using setCamera. This should now work in
the SVN version of the OSG.
Hi,
I´ve tried this, and it works for taking the screenshot, but when
resetting the sceneview to the old camera, rendering no longer works. I
get a black screen. My osg-version is from about two weeks ago. Does
this matter? Should I upgrade?
I just saved the old camera:
osg::ref_ptr<osg::Camera> oldcamera = sceneView->getCamera();
and then reset it after taking the screenshot:
sceneView->setCamera(oldcamera.get());
Thanks,
Andreas
Another route would be to do something like what the SVN vesion of
osgdistortion does - it has a Viewer that contains a set of slave
cameras, these slaves doing the RTT work.
Robert.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/