Thanks John. I'll give it a try. 

So I assume that this overrides the osgViewer default light settings?

Thanks again for the help...

-Shayne

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Argentieri,
John-P63223
Sent: Tuesday, June 10, 2008 4:36 PM
To: [EMAIL PROTECTED]
Subject: Re: [osg-users] lighting in osgViewer...

Shayne,
 
If you really want to control lighting, you have to use osg::Light and
osg::LightSource. If you look at the code for the example "osglight" you
will see how those types of lights are set up.
 
Say for instance, you want a constant, non-directional light.
Copy the "osglight" example, but instead of what they do with the
osg::Light, do:
 
m_Light = new osg::Light();
m_Light->setLightNum( 0 ); // this will override the "Look at me, I am the
sun" light.
m_Light->setAmbient( osg::Vec4f( 1.0f, 1.0f, 1.0f, 1.0f ) );
m_Light->setDiffuse( osg::Vec4f( 0.0f, 0.0f, 0.0f, 0.0f ) );
 
and you don't  have to worry about where it's located because it has 0
directional lighting.
John Argentieri 
Software Engineer 
GENERAL DYNAMICS 
C4 Systems 
(407) 281-5568 
[EMAIL PROTECTED] 

"This email message is for the sole use of the intended recipient(s) and may
contain GDC4S confidential or privileged information. Any unauthorized
review, use, disclosure or distribution is prohibited. If you are not an
intended recipient, please contact the sender by reply email and destroy all
copies of the original message."


________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tueller,
Shayne R Civ USAF AFMC 519 SMXS/MXDEC
Sent: Tuesday, June 10, 2008 6:09 PM
To: [email protected]
Subject: [osg-users] lighting in osgViewer...



This may be a silly question but can anyone enlighten me on what
osgViewer::setLight() does? Does it set the attributes for a global light
source in the scene? I want to change the defaults in the viewer.

 

Thanks in advance

-Shayne

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to