Thanks Zach.
The point is, I need images drawn only once, before game main loop.
Prerender example sets up dynamic prerender to texture with usage of
callbacks. So every frame prerendering gets called.
I was wondering if there is a way, to prerender node to a image (or
texture). Then when game runs, i would like to display this image on hud.
Thanks!
2007/9/4, Zach Deedler <[EMAIL PROTECTED]>:
>
> Hi Ivan,
>
>
>
> I have this code:
>
> for(Viewer::EventHandlerList::iterator itr =
> m_poViewer->getEventHandlerList().begin();
>
> itr != m_poViewer->getEventHandlerList().end();
>
> ++itr){
>
> ViewerEventHandler* viewerEventHandler =
>
> dynamic_cast<ViewerEventHandler*>(itr->get());
>
> if (viewerEventHandler){
>
> viewerEventHandler->setWriteImageFileName(pszFile);
>
> viewerEventHandler->setWriteImageOnNextFrame(true);
>
> return 0;
>
> }
>
> }
>
>
>
> Maybe you can search the code for setWriteImageFileName and back track
> from there?
>
>
>
> I believe there is a function call to do what you want for a camera.
>
>
>
> Also, osgprerender renders a scene to a texture every frame. If you did
> that then you can probably just save off the texture by calling an
> osg::Texture or osg::Image call.
>
>
> ------------------------------
>
> *From:* [EMAIL PROTECTED] [mailto:
> [EMAIL PROTECTED] *On Behalf Of *Ivan Bolcina
> *Sent:* Tuesday, September 04, 2007 3:44 PM
> *To:* [email protected]
> *Subject:* [osg-users] Render to texture
>
>
>
>
> Hi.
>
> I just want to render a simple node to a texture. All the examples are
> using callbacks, osg viewer,etc.. I don't understand all that, I just want
> to set up geometry, projection and new camera and then take one shoot with
> camera and that's it.
>
> So I need a simple function like this
>
> osg::Image * CreateTopDownShotOfNode( osg::Node * node);
>
> The main problem is how to tell osg to render using that camera.
>
> thx
>
> _______________________________________________
> 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