[osg-users] Setting Colors

2008-05-21 Thread Daniel Moos
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

Re: [osg-users] Setting Colors

2008-05-21 Thread 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

Re: [osg-users] Setting Colors

2008-05-21 Thread Daniel Moos
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_ptrosg::Material material = new osg::Material; material-setColorMode(osg::Material::AMBIENT_AND_DIFFUSE); // switch glColor usage off

Re: [osg-users] Setting Colors

2008-05-21 Thread Robert Osfield
HI Daniel, You'll need to use the osg::Material StateAttribute to set two sided lighting, the ColorArray on the osg::Geometry won't help you here as it only supports a single colour (as does OpenGL for vertex colours). For info on osg::Material its best to consult OpenGL docs of glMaterial

Re: [osg-users] Setting Colors

2008-05-21 Thread 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_ptrosg::Material material = new osg::Material;

Re: [osg-users] Setting Colors

2008-05-21 Thread Daniel Moos
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_ptrosg::LightModel lightModel = new osg::LightModel(); lightModel-setTwoSided ( true ); states-setAttributeAndModes ( lightModel.get(),