Thank you very much...
Now it works great. Here is my code if other has the same problem.

    //create twosided lightning for model
    osg::ref_ptr<osg::LightModel> lightModel = new osg::LightModel();
    lightModel->setTwoSided ( true );
states->setAttributeAndModes ( lightModel.get(), osg::StateAttribute::ON );

    //create material with red back-light
    osg::ref_ptr<osg::Material> material = new osg::Material;
    material->setColorMode ( osg::Material::OFF );
material->setEmission ( osg::Material::BACK, osg::Vec4(1.0f, 0.0f, 0.0f, 1.0f) ); states->setAttributeAndModes ( material.get(), osg::StateAttribute::ON );


Thanks, Daniel


Am 21.05.2008 um 11:33 schrieb Robert Osfield:

On Wed, May 21, 2008 at 10:06 AM, Daniel Moos <[EMAIL PROTECTED]> wrote:
Thanks for your reply...
I already have played a little bit with osg::Material. But I don't create
two colors... Below is my try:
   osg::ref_ptr<osg::Material> material = new osg::Material;
material->setColorMode(osg::Material::AMBIENT_AND_DIFFUSE); // switch
glColor usage off

material->setColorMode(osg::Material::OFF)l // switchings glColor usage off...

You'll also need to enable the two sided lighting model via
osg::LightModel stata attribute.

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

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