Thanks Thomas - Great News!
I've been trying to get my eqOSG example running using one osgViewer per
Pipe using slave cameras per Channel, However I was wondering whether my
implementation is conceptually correct in terms of how equalizer manages
tasks:
I have a class member osgViewer::Viewer in my Pipe implementation, it is
initialized there in configInit()
//////////////////////////////////////////////////////////////////
bool Pipe::configInit( const uint32_t initID )
{
std::cout<<"Pipe::configInit "<<initID<<std::endl;
if( !eq::Pipe::configInit( initID ))
return false;
Config* config = static_cast<Config*>( getConfig( ));
const InitData& initData = config->getInitData();
const uint32_t frameDataID = initData.getFrameDataID();
viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded);
const eq::PixelViewport& channelviewport = getPixelViewport();
viewer->getCamera()->setViewport( channelviewport.x,channelviewport.y,
channelviewport.w,channelviewport.h );
//set the graphics context
mContext = new osgViewer::GraphicsWindowEmbedded;
viewer->getCamera()->setGraphicsContext( mContext );
osg::ref_ptr<osg::Node> root =
osgDB::readNodeFile("data/cow.osg");//createSceneGraph().get();
viewer->setSceneData(root.get());
}
////////////////////////////////////////////////////////////////////
In my Channel Implementation I set up the osg::camera slaves and add
them to the Pipe osgViewer :
////////////////////////////////////////////////////////////////////
bool Channel::configInit( const uint32_t initID )
{
std::cout<<"Channel::configInit "<<initID<<std::endl;
std::cout<<"Channel::configInit "<<initID<<std::endl;
//Get the Viewer
Pipe* pipe = static_cast<Pipe*>( getPipe( ));
viewer = pipe->getViewer();
//set up slave cameras
camera = new osg::Camera;
//Add the Graphics Context from the pipes viewer
mContext = pipe->getGraphicsContext();
camera->setGraphicsContext( mContext );
//Add this channels slave camera to osgViewer
viewer->addSlave(camera.get(), osg::Matrixd(), osg::Matrixd());
}
////////////////////////////////////////////////////////////////////
Then in Channel::frameDraw:
////////////////////////////////////////////////////////////////////////////////
void Channel::frameDraw( const uint32_t frameID )
{
eq::Channel::frameDraw( frameID );
camera->setGraphicsContext( mContext );
const vmml::Frustumf& channelfrustum = getFrustum();
camera->setProjectionMatrixAsFrustum(channelfrustum.left,
channelfrustum.right,channelfrustum.bottom,
channelfrustum.top,channelfrustum.nearPlane,channelfrustum.farPlane );
const eq::PixelViewport& channelviewport = getPixelViewport();
camera->setViewport( channelviewport.x,channelviewport.y,
channelviewport.w,channelviewport.h );
outlineViewport();
}
////////////////////////////////////////////////////////////////////////////////
A number of problems I'm getting is I'm not sure where to put
osgViewer::Viewer::frame() function call - A simple Hack at the moment
is to put it in Channel::frameDraw() or Pipe::frameStart().
I can run the application ... but with errors, namely:
./lib/net/nullCM.h:46 Code is not supposed to be called in this context
anyone has any ideas or thoughts on implementation or the proper setup?
On Wed, 2009-01-14 at 19:22 +0100, Thomas McGuire wrote:
> Hi,
>
> On Tuesday 13 January 2009 16:25:00 Stefan Eilemann wrote:
> > The past discussions on this list show that there is a substantial
> > demand for an example integrating OpenSceneGraph and Equalizer.
> > Unfortunately nobody has stepped forward and taken the lead (this
> > includes me, for lack of time).
>
> Same for me, due to other commitments I don't really have the tame to be a
> project lead here.
>
> > So - I am looking for somebody in the community to take over this
> > task. A first step would be to create a simple example integrating the
> > glue code posted by Thomas and Adrian. This example can then be used
> > to add additional features, e.g., scene graph data distribution.
>
> I will post our (a group of students at the Computer Graphics and Multimedia
> Systems Group of Siegen University) complete eqOSG here during the next days,
> so everybody, please wait a bit for creating the example, as I only need to
> clean ours up and send it to you :)
> The project is CMake-based and can either draw a rotating quad or load a
> model
> (that part is not fully working yet, but it will when I send it here).
>
> > Please step forward if you want to take on this task, the eternal
> > gratitude of the osg and Eq communities will be yours!
>
> Will they build a shrine?
>
> Regards,
> Thomas
> _______________________________________________
> eq-dev mailing list
> [email protected]
> http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
> http://www.equalizergraphics.com
IMPORTANT: This email remains the property of the Australian Defence
Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT
1914. If you have received this email in error, you are requested to contact
the sender and delete the email.
_______________________________________________
eq-dev mailing list
[email protected]
http://www.equalizergraphics.com/cgi-bin/mailman/listinfo/eq-dev
http://www.equalizergraphics.com