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: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 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;
            
                 ...





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to