Ah, nevermind. I found the solution to my problem in the archives of very
same users list I'm writing to!

http://openscenegraph.net/archiver/osg-users/2003-November/0237.html



On 4/25/07, Jason <[EMAIL PROTECTED]> wrote:

Additionally, I'm using the setDefaults call for my SceneView and I'm
setting up a HEADLIGHT for the scene. This works well, but my main problem
is I scale the size of my planes and tanks as I soon in and out so they
appear the same size on the screen. Zooming out, thus scaling the planes and
tanks larger, causes the entity to appear unlit, or black. Is there a trick
around this?

On 4/25/07, Jason <[EMAIL PROTECTED]> wrote:
>
> Is it possible to take the lighting scheme from osgProducer::Viewer and
> apply it to my own SceneView? I'm not happy with my current lighting
> situation but for my specific purposes I need to roll with my own SceneView
> instead of using the viewer. Admittedly, I don't know much if anything about
> lighting. Whatever code I have is stuff I grabbed from the examples.
>
> Specifically, I have a light over the top of my terrain but and that
> lights it just fine, but my open flight models (tanks, planes, etc.) all
> show up brightly and you can't see any contours on the model like you can in
> osgProducer::Viewer. I'm guessing it probably has something to do with the
> ambient lighting.
>
>       osg::BoundingBox bb;
>       bb.expandBy(bs);
>
>       osg::Light* myLight = new osg::Light;
>       myLight->setLightNum(0);
>       myLight->setPosition(osg::Vec4(bb.corner(4),1.0f));
>       myLight->setAmbient(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
>       myLight->setDiffuse(osg::Vec4(1.0f,1.0f,1.0f,1.0f));
>
>       myLight->setDirection(osg::Vec3(1.0f,1.0f,-1.0f));
>
>       osg::LightSource* lightS1 = new osg::LightSource;
>       lightS1->setLight(myLight);
>       lightS1->setLocalStateSetModes(osg::StateAttribute::ON);
>
>       lightS1->setStateSetModes(*ss,osg::StateAttribute::ON);
>       group->addChild(lightS1);
>
> Thanks,
> Jason
>


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to