[eq-dev] Equalizer + OpenSceneGraph: Compile problems on Windows
Thomas McGuire
thomas.mcguire at student.uni-siegen.de
Mon Jan 5 11:09:54 CET 2009
Hi,
On Monday 05 January 2009 20:03:55 Paul wrote:
> Good work Thomas. Any plan to release the code or an example ?
I'm not sure what our internal policy is about releasing the complete code. Anyway, we basically took the eqPly example and added
rendering with a osgViewer::Viewer to it.
For this to work, the following needs to be done:
- in Channel::frameDraw, pass the frustum and the viewport of the channel to
the camera of the viewer.
- Set a osgViewer::GraphicsWindowEmbedded as the context of the camera so that
OSG doesn't try to create its own window.
That is all.
The relevant code is:
bool Channel::configInit( const uint32_t initID )
{
if( !eq::Channel::configInit( initID ))
return false;
osg::ref_ptr<osg::Node> root = createSceneGraph().get();
mViewer = new osgViewer::Viewer();
mViewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
mViewer->setSceneData(root.get());
mContext = new osgViewer::GraphicsWindowEmbedded;
return true;
}
void Channel::frameDraw( const uint32_t frameID )
{
eq::Channel::frameDraw( frameID );
mViewer->getCamera()->setGraphicsContext( mContext.get() );
const vmml::Frustumf& channelfrustum = getFrustum();
mViewer->getCamera()->setProjectionMatrixAsFrustum(
channelfrustum.left, channelfrustum.right,
channelfrustum.bottom, channelfrustum.top,
channelfrustum.nearPlane, channelfrustum.farPlane );
const eq::PixelViewport& channelviewport = channel->getPixelViewport();
mViewer->getCamera()->setViewport( channelviewport.x,channelviewport.y,
channelviewport.w,channelviewport.h );
mViewer->frame();
}
Regards,
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://www.equalizergraphics.com/pipermail/eq-dev/attachments/20090105/c059e620/attachment.pgp
More information about the eq-dev
mailing list