[osg-users] How to take a picture of my scene?

Gordon Tomlinson gordon.tomlinson at sensor.com
Tue Jul 15 09:42:15 PDT 2008


A search of the mailing list archives will answer this often asked question
 
you need a valid graphics context to do this which is typically available in
the draw process, t

  _____  

From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Carlos
Sanches
Sent: Tuesday, July 15, 2008 12:23 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] How to take a picture of my scene?



I continue to render a black screen :( 
How do I have to use de postdrawcallback ?
I m using this code:

 bool myKeyboardEventHandler::handle(const osgGA::GUIEventAdapter&
ea,osgGA::GUIActionAdapter& aa)
 {
      switch(ea.getEventType())
       {
       case(osgGA::GUIEventAdapter::KEYDOWN):
          {
               switch(ea.getKey())
               {
                 case 'a':
                    
                     image->readPixels(0,0,200,200,
GL_RGB,GL_UNSIGNED_BYTE);
                     osgDB::writeImageFile(*image,"capture.bmp");
                       
                     return false;
                 break;
            
                 ...





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080715/23e10411/attachment-0003.htm>


More information about the osg-users mailing list