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

2008-07-30 Thread David Spilling
Look in the osghandglide example for MoveEarthySkyWithEyePointTransform;
you will need to add the z-coordinate transform as well (currently 0.0 in
the code).

David
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2008-07-30 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Viggo,

Thanks much...:)

-Shayne

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 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() );
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 -0600
From: [EMAIL PROTECTED]
To: osg-users@lists.openscenegraph.org
Subject: [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




Få Hotmail du også. Windows Live Hotmail nå med 5000 MB gratis
lagringsplass.
http://clk.atdmt.com/GBL/go/msnnkdre001005gbl/direct/01/ 


smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2008-07-30 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
David,

Thanks for your help as well...

-Shayne

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David
Spilling
Sent: Wednesday, July 30, 2008 1:31 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] sky model tracking the camera...

Look in the osghandglide example for MoveEarthySkyWithEyePointTransform;
you will need to add the z-coordinate transform as well (currently 0.0 in
the code).

David




smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2008-07-29 Thread Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC
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



smime.p7s
Description: S/MIME cryptographic signature
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2008-07-29 Thread Viggo Løvli

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/msnnkdre001003gbl/direct/01/___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2008-07-29 Thread Viggo Løvli

Forgot one thing...
At end of traverse function:
osg::Group::traverse( nv );
 
My sky is a osg::Group which hold a pointer to the postionTransfor object, so I 
am therefore calling osg::Group::traverse and not something else :-)
 
Viggo



From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: Wed, 30 Jul 2008 07:56:01 
+0200Subject: 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() );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

Få Hotmail du også. Windows Live Hotmail nå med 5000 MB gratis lagringsplass. 
_
Hold deg oppdatert med MSN på mobilen.
http://info.mobile.no.msn.com/pc/default.aspx?ocid=30032___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org