OK, this is an exaple (flat square road): Code:
osg::Geometry* geometry = getGeometry(); osg::Vec3 myCoords[] = { osg::Vec3(-1.0f,1.0f,0.0f), osg::Vec3(-1.0f,-1.0f,0.0f), osg::Vec3(1.0f,-1.0f,0.0f), osg::Vec3(1.0f,1.0f,0.0f) }; int numCoords = sizeof(myCoords)/sizeof(osg::Vec3); geometry->setVertexArray(new osg::Vec3Array(numCoords,myCoords)); unsigned short myIndices[] = { 0, 1, 2, 0, 2, 3 }; int numIndices = sizeof(myIndices)/sizeof(unsigned short); geometry->addPrimitiveSet(new osg::DrawElementsUShort(osg::PrimitiveSet::TRIANGLES,numIndices,myIndices)); Gianni ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=60459#60459 _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org