Simon, For the geometry, I do this, more or less:
osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry(); > > osg::ref_ptr<osg::Vec3Array> vertices = new osg::Vec3Array; // unsized > array of vertices > > vertices->push_back(osg::Vec3(x,y,z)); // etc, > ... > > osg::ref_ptr<osgUtil::DelaunayTriangulator> dt = new > osgUtil::DelaunayTriangulator(vertices.get()); > dt->triangulate(); // Generate the triangles > geometry->setVertexArray(vertices.get()); > geometry->addPrimitiveSet(dt->getTriangles()); > and then add the colour array as per the osggeometry example. For colouring it in by z-value, I also use a texgen to set up texture coordinates; something like this osg::StateSet* stateset = getOrCreateStateSet(); > stateset->setTextureAttributeAndModes(0, > m_texture,osg::StateAttribute::ON); > > osg::ref_ptr<osg::TexGen> texgen = new osg::TexGen; > texgen->setMode(osg::TexGen::OBJECT_LINEAR); texgen->setPlane(osg::TexGen::S,osg::Vec4(0.0f,0.0f,1,0)); > > stateset->setTextureAttributeAndModes(0,texgen.get(),osg::StateAttribute::ON); > The "m_texture" is a texture containing a coloured bar image, with which your elevation will get shaded. Hope thats a good pointer... David
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

