[osg-users] sky model tracking the camera...

Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC Shayne.Tueller at HILL.af.mil
Wed Jul 30 14:55:49 PDT 2008


Thanks much...:)


-----Original Message-----
From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Viggo Løvli
Sent: Tuesday, July 29, 2008 11:56 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] sky model tracking the camera...

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() );
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,


Date: Tue, 29 Jul 2008 18:14:25 -0600
From: Shayne.Tueller at HILL.af.mil
To: osg-users at lists.openscenegraph.org
Subject: [osg-users] sky model tracking the camera...



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



Få Hotmail du også. Windows Live Hotmail nå med 5000 MB gratis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6028 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080730/82cdd22f/attachment-0003.bin>

More information about the osg-users mailing list