Hi Shayne,
Add your sky node where-ever you want it in your scene-graph (not as child of
camera). Override the sky's transform node's traverse function and do something
like this:
void yourNode::traverse( osg::NodeVisitor& nv )
{
switch( nv.getVisitorType() )
{
case osg::NodeVisitor::CULL_VISITOR:
setPosition( nv.getEyePoint() );
break;
}
}
Your node will be set to the camera position on each cull-traverse. It will
therefore work properly nomatter how many camera or render passes you add to
your scene.
Hope it helps,
Viggo
Date: Tue, 29 Jul 2008 18:14:25 -0600From: [EMAIL PROTECTED]: [EMAIL
PROTECTED]: [osg-users] sky model tracking the camera...
Hello,
I would like to have my sky model track the camera position so that as the
camera moves, the sky model moves with it. To do this, would I add the sky
model transform as a child of the cameraNode? Does anyone have any code
snippets that may demonstrate how I might do this?
Thanks in advance…
-Shayne
_________________________________________________________________
Hold kontakten med Windows Live Messenger.
http://clk.atdmt.com/GBL/go/msnnkdre0010000003gbl/direct/01/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org