Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: tesselation?

  1. #1
    Junior Member Newbie
    Join Date
    May 2003
    Location
    Bangalore, India
    Posts
    6

    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

  2. #2
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Philadelphia
    Posts
    332

    Re: tesselation?

    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.

  3. #3
    Junior Member Newbie
    Join Date
    May 2003
    Location
    Bangalore, India
    Posts
    6

    Re: tesselation?

    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->setPrimCount(1);


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

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

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

    Warm regards
    shashi

  4. #4
    Member Regular Contributor
    Join Date
    May 2000
    Location
    Philadelphia
    Posts
    332

    Re: tesselation?

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •