Hiya,

I have a bunch of shapes that can be kind of complex that I want to
draw in osg, and I only have their border points available. I can draw
them fine if I use the tessellator util. What I'd like to know is what
underlying primitives are sent to OpenGL when I do tessellation. For
example, here's some code:

    osg::ref_ptr<osg::Geometry> geom = new osg::Geometry;
    geom->setVertexArray(vertices.get());
    geom->addPrimitiveSet(new osg::DrawArrays(GL_POLYGON,0,numOuterPolyPoints));
    geom->addPrimitiveSet(new osg::DrawArrays(GL_POLYGON,numOuterPolyPoints,
                                                  numInnerPolyPoints));

    osgUtil::Tessellator geomTess;
    geomTess.setTessellationType(osgUtil::Tessellator::TESS_TYPE_GEOMETRY);
    geomTess.retessellatePolygons(*geom);

    osg::ref_ptr<osg::Geode> nodeGeom = new osg::Geode;
    nodeArea->addDrawable(geom);
    myRootNode->addChild(nodeGeom);

I've read that GL_POLYGON is slow, unavailable with OpenGL ES and even
deprecated after 3.x. Does the Tessellator change the initial
primitive type? Should I be doing the above code differently to
maximize compatibility and/or performance (ie use a triangle
primitive)? If so, how?


Regards,

Preet
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to