Hi Nadia,

On 25/6/09 10:42 AM, Nadia Comanici wrote:
Thank you, J-S, but unfortunately the object still looks flat :(

Let me guess, is it green? ;-)

On 24/6/09 10:40 PM, Nadia Comanici wrote:
>    // Generate the triangles
> osg::ref_ptr<osgUtil::DelaunayTriangulator> triangulation = new osgUtil::DelaunayTriangulator(points);
>    triangulation->triangulate();                
>
>    //set the points and triangles
>    geometry->setVertexArray(points);
>    geometry->addPrimitiveSet(triangulation->getTriangles()); 
>
>    //set the color
>    osg::Vec4Array * colors = new osg::Vec4Array(1);
>    colors->push_back(osg::Vec4d(0.0,1.0,0.0,1.0));
>    geometry->setColorArray(colors);
>    geometry->setColorBinding(osg::Geometry::BIND_OVERALL);      

You're setting a single vertex color for the entire geometry. Lighting calculations are only done on Material. By removing the color array you should at least see the object in white but shaded according to light.

Hope this helps.
/ulrich
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to