Hi,

have you tried writing the image in the camera callback? Maybe have a look at osgprerender and osgscreencapture.

jp

Dominic Stalder wrote:
Sorry for hesitating, but the time of our project is running ;-)

Someone any idea what I did wrong with the texture / image camera? Or is there a problem with the addChild hirarchy?

Thanks a lot

Am 03.01.10 12:05, schrieb Dominic Stalder:
Hi Ulrich

thanks a lot, big mistake ;-)

Now the color is not black any more, but it only takes the gl clear color of the the camera. Do I have to set some view matrices?

Dominic

Am 03.01.10 11:50, schrieb Ulrich Hertlein:
Hi Dominic,

a happy new year to you too.

On 2/01/10 10:00 PM, Dominic Stalder wrote:
     Image* image = new Image;
     image->allocateImage(osgViewer->width(), osgViewer->height(), 1,
GL_RGBA, GL_UNSIGNED_BYTE);

// creates a new camera that will render into the image and sets the
rendering settings
     ref_ptr<Camera>  imgCamera = new Camera;
...
     imgCamera->addChild(rootLighting.get());

     root->addChild(imgCamera.get());

     osgDB::writeImageFile(*image, "/Users/xyz/tmp/test.bmp");

It allocates the image with the right size (1400 x 736) and writes it to
disk. But the image is all black.
Did you omit some code between 'root->addChild()' and 'writeImageFile'? There should be a call to render the frame (like 'osgViewer->frame()') otherwise the Image will remain black.

Does anybody see an error or what could be the problem? I also tried
with GL_INT instead of GL_UNSIGNED_BYTE but this didn't work too. Is
there a problem with the hirachy:
GL_U_B is fine, this will probably also give you better performance.

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


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


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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

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

Reply via email to