Hi,
Sorry, my bad.
Basically, I want to "triangulate" polygons. I have polygon with more than 3
vertices and I want to retrieve the "sub-polygons" (simple triangles) using the
osg tesselation tool.
Here is some code. In my "surface" class, after creating my geometry, I
tessellate it if it has more than 3 vertex :
Code:
geometry->addPrimitiveSet(new
osg::DrawArrays(osg::PrimitiveSet::POLYGON,0,vertices->size()));
tessellator = new osgUtil::Tessellator();
if(vertices.size()>3){
tessellator->setTessellationType(osgUtil::Tessellator::TESS_TYPE_POLYGONS);
tessellator->setWindingType(
osgUtil::Tessellator::TESS_WINDING_NONZERO);
tessellator->retessellatePolygons(*geometry);
}
And what I would like to do now is to get the list of "triangles" from my
geometry.
By looking at the code of the OSG tesselator, I understood that it creates new
PrimitiveSet but I can't figure out how exactly how to do it.
Sorry again and thank you!
Bob
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48027#48027
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org