[osg-users] PrimitiveSet lighting issues
Cysneros, Nelson SPAWAR
nelson.cysneros at navy.mil
Mon Sep 24 11:26:06 PDT 2007
I'm drawing osg::PrimitiveSet::LINES deep inside my node architecture.
The lines come up the right color, but depending on the camera position,
the line tends to turn black. I would like the line color to stay
constant regardless of the camera position.
>From doing some research it seems like my problem could be either
normals or light source, but I've played with both a lot and can not get
it to work.
This is what my current settings are. Any suggestions would be greatly
osg::Vec3Array* norms = new osg::Vec3Array(1);
(*norms) = osg::Vec3(1,0.0f,1.0f);
//Add light source to geom
osg::LightSource* lightSource = new osg::LightSource;
osg::Light* light = lightSource->getLight();
osg::StateSet* statelightON_OVRD = mgroup->getOrCreateStateSet();
// light->setPosition(osg::Vec4(0.0f,0.0f,0.0f,1.0f)); // directional
light from above
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users