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->setAmbient(osg::Material::FRONT, osg::Vec4(0.0,1.0f, 0.0f,1.0f)); material->setDiffuse(osg::Material::FRONT, osg::Vec4(0.0,1.0f, 0.0f,1.0f)); material->setSpecular(osg::Material::FRONT, osg::Vec4(0.0,1.0f, 0.0f,1.0f)); material->setEmission(osg::Material::FRONT, osg::Vec4(0.0,1.0f, 0.0f,1.0f));
material->setAmbient(osg::Material::BACK, osg::Vec4(1.0,0.0f,0.0f, 1.0f)); material->setDiffuse(osg::Material::BACK, osg::Vec4(1.0,0.0f,0.0f, 1.0f)); material->setSpecular(osg::Material::BACK, osg::Vec4(1.0,0.0f, 0.0f,1.0f)); material->setEmission(osg::Material::BACK, osg::Vec4(1.0,0.0f, 0.0f,1.0f));
states- >setAttributeAndModes(material.get(),osg::StateAttribute::OVERRIDE| osg::StateAttribute::ON); states->setMode(GL_LIGHTING,osg::StateAttribute::OVERRIDE| osg::StateAttribute::ON);
But I don't get a different front and back color. Is there a simple example for my problem? Thank you very much. Daniel Am 21.05.2008 um 10:29 schrieb Alberto Luaces:
El Miércoles 21 Mayo 2008ES 10:18:58 Daniel Moos escribió:Good morning @all I have a question about setting colors of a geometry. We have 3d- objects which is described by a triangle area. This triangle area has a color, which is set with a ColorArray and a ColorBinding (BIND_OVERALL) Now I want to give a inner and outer color for the triangle area. How can I do this? An example: The inside of the triangle area should be red and the outside should be green. See the attachement Thanks for your help... Have a nice day. DanielHi,it would be easier using materials, because you can specify different colourvalues depending on the face (face = front or back) that you want. See http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01287.html _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

