tesselation?

How do I tesselate polygons with optimizer/performer. I tried to use the opTessAction class but was unsuccessful. My problem is that I am unable to render concave polygons corectly with both optimizer and performer and hence I wanted to tesselate the polygon. In performer I tried to use the pfdTriangulatePoly in the pfdUtil library which is supplied as unsupported code. The program crashes. Can anybody please advice me on how I can tesselate polygons (concave specifically) with optimizer/performer.

shashi

We use opTessAction for trimmed surfaces without any big problem. If you can post your code or/and how you are using it, I may be able to give you more advice.

Originally posted by Coconut:
We use opTessAction for trimmed surfaces without any big problem. If you can post your code or/and how you are using it, I may be able to give you more advice.

Here is the polygon (concave) I want to tesselate and render.
static float cubeCoords[4][3] =
{
{ -1.0, -1.0, 1.0 },
{ 0.0, -0.5, 1.0 },
{ 1.0, -1.0, 1.0 },
{ 0.0, 1.0, 1.0 }
};
(just modified some pre-existing code, cubecoords is a bit out of place. but here it is the array of coords of my polygon)

csPolySet *gset = new csPolySet;
csCoordSet3f *cset = new csCoordSet3f;
cset->point()->edit();
cset->point()->setRange(0, numCubeCoords, (csVec3f *)cubeCoords);
cset->point()->editDone();
gset->setCoordSet(cset);
csIndexSet *iset=new csIndexSet;
iset->index()->edit();
for( unsigned int i=0;i<cset->point()->getCount();i++)
{
iset->index()->set(i,i);
}
iset->index()->editDone();
gset->setCoordIndexSet(iset);

gset-&gt;setPrimCount(1);

// the tesselation part
opTessellateAction *tessAct;
csShape *greenShape = new csShape;
greenShape->setAppearance(greenAppearance);
greenShape->setGeometry(0, gset);

tessAct = new opTessellateAction;
tessAct -&gt; apply( greenShape ); // this did not work so I tried this

tessAct -&gt; apply( root ); // even this did not

Warm regards
shashi

Sorry but I was out of town for several days. To make it work, you need opTessParaSurfaceAction. Use opPlane, and define a concave trimming curve on the plane.