Sorry for the previous mail. I'm a little confused. My camera is configured
to take Y-axis as UP axis. In my 3D-model, I put the helmet so that the
bottom of the helmet correspond to negative Y, and the top to positive Y (cf
attached figure). The camera look at (0, 0, 0). Thus I can obtain the
attached image. To enlight the scene I put the light at 0 on X-axis so the
region around the bottom corners of the square be enlighten the same way
(the square is in the XY plane). However the region around bottom-left
corner is darker than the region around bottom-right corner. What have I
missed?

Jean-Baptiste

2008/6/18 Jean-Baptiste Authesserre <[EMAIL PROTECTED]>:

> Hi,
>
> I am a little confused. My camera
>
> 2008/6/18 Paul Melis <[EMAIL PROTECTED]>:
>
> Jean-Baptiste Authesserre wrote:
>>
>>> Hi everyone,
>>>
>>> I have some problem with OSG Light, and I don't find answer in the osg
>>> archives. My problem is the following : I don't understand why with the
>>> following code my object isn't uniformly enlighten. (cf. image in attached
>>> document)
>>> -The black and white square of the image is centered at (0, 0, 0) (in
>>> world frame with convention (x, y, z))
>>> -The camera is located at (0, 0, -20)
>>> -the light is located at (0,20, -15)
>>>
>> If you didn't change this yourself then +Z will be the up axis, btw
>>
>>>
>>>
>>> The code for activating light is the following:
>>>
>>> /*****************************
>>> ** light *************************************/
>>>
>>>
>>>    //Creation of light source
>>>    osg::Light* light = new osg::Light();
>>>    osg::LightSource * lightsource = new osg::LightSource();
>>>    lightsource->setLight(light);
>>>    // put the light source in the scenegraph
>>>    root->addChild(lightsource);
>>>
>>>    // turn light on
>>>    osg::StateSet * stateset = root->getOrCreateStateSet();
>>>    lightsource->setStateSetModes(*stateset, osg::StateAttribute::ON);
>>>    light->setAmbient(osg::Vec4d(1.0, 1.0, 1.0, 1.0));
>>>    //light->setDiffuse(osg::Vec4d(0.0, 0.0, 0.0, 0.0));
>>>    //light->setSpecular(osg::Vec4d(1.0, 1.0, 1.0, 1.0));
>>>    light->setPosition(osg::Vec4d(0.0, 20.0, -15.0, 1.0));
>>>
>>>
>>> /******************************************************************************/
>>>
>>> So, I don't understand why the bottom-left corner of my square is darker
>>> than the others corners
>>>
>> I don't see any difference here between left and right bottom corners,
>> they're equally dark IMHO. Which seems to make sense, as you've put the
>> light source above and little in front of the camera, but in the center of
>> the object (the X plane).
>>
>> Paul
>>
>>> Has anybody an Idea?
>>>
>>>
>>> Best regards,
>>>
>>> Jean-Baptiste.
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>

<<attachment: 001.jpg>>

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

Reply via email to