Hey I am playing arround with the OSG lighting functions, and am fairly new to
it all.
Anyway I am using OSGART with OSG which shouldnt make a difference.
I have a MatrixTransform and its child is PositionAttitudeTransform and its
child is a 3d Model.
I have lighting as a child of the MatrixTransform with following settings:
osg::StateSet* state = root->getOrCreateStateSet();
state->setMode( GL_LIGHTING, osg::StateAttribute::ON );
state->setMode( GL_LIGHT0, osg::StateAttribute::ON );
state->setMode( GL_LIGHT1, osg::StateAttribute::ON );
osg::ref_ptr<osg::Light> light = new osg::Light();
light->setLightNum(0);
light->setAmbient( osg::Vec4( 0.6f, 0.6f, 0.6f, 1.0f ));
light->setDiffuse( osg::Vec4( .9f, .9f, .9f, 1.f ));
light->setSpecular( osg::Vec4( .8f, .8f, .8f, 1.f ));
lsource->setLight(light);
lsource->setReferenceFrame(osg::LightSource::ABSOLUTE_RF);
I scale the PositionAttitudeTransform by (5,5,5) for example, because my model
is too small, but then the lighting isnt sufficient. Is there a way to scale
the lighting as well ? Or how can I keep the light constant with scaling the
model ?
Hope you understand my problem if you need more info, Ill be glad to give it,
thanks in advance for the help!
David
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=16253#16253
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org