HI Andy,

Why not just use osg::CameraNode as per the osgprerender example?  It has a block where it attaches an osg::Image to the RTT camera and use this result processing the image and rewriting it to the main scene graph.  Lots of examples using CameraNode for RTT use FBO's with the result being applied as textures in later drawing code.  For the later drawing code the main camera's view and projection matrix apply, or you can set you own view matrix using an absolute transform, or even use CameraNode set to NESTED render order to override both the view and projection matrices.

Robert.

On 10/3/06, Andy Preece <[EMAIL PROTECTED]> wrote:

Hi All,

 

I am developing an OSG application that renders a scene, captures the framebuffer, analyses the contents and then renders some additional geometry based on the results of analysis.

 

I can render and capture the scene but I am having problems creating a second rendering pass to draw the analysis geometry. Currently I am using an osg::Geometry object which I render explictitly using the osg::Drawable::draw() method. It looks as if the geometry is being draw with an incorrect view or projection matrix.

 

Rather than just get the view and projection matrix from the osgUtil::SceneView and use OpenGL calls to set the matracies, is there a more OSG friendly way to achieve what I want?

 

The psuedo code looks like this:

 

// Initialisation

m_SceneView = new osgUtil::SceneView ;

m_SceneView -> setDefaults() ;

 

// Render loop

m_SceneView -> setFrameStamp( frameStamp ) ;

m_SceneView -> setViewMatrix( m_KBMCallback -> getViewMatrix() );

m_SceneView -> update();

m_SceneView -> cull();

m_SceneView -> draw();

 

glReadPixels(0, 0, outScreenSize[0], outScreenSize[1], GL_RGBA, GL_UNSIGNED_BYTE, testImageBuffer );

processBuffer( testImageBuffer ) ;

 

(osg::Geometry *)symbology -> draw( *m_SceneView -> getState() ) ;

 

m_RenderSurface -> swapBuffers();

 

Regards,

Andy


________________________________________________________________________
This e-mail has been scanned for all viruses by Star.The service is powered by MessageLabs.
________________________________________________________________________

_______________________________________________
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/

Reply via email to