This project is read-only.

tessellation problem

Nov 21, 2012 at 4:03 PM
Edited Nov 21, 2012 at 4:04 PM

Hi, I'm trying to use tessellation in sharpgl. gl.TessBeginPolygon(tess,pdata); etc...

But its not working. I have two problems, I cant send null on data in gl.TessBeginPoligon, so I have to send a quadric pointer. Second problem is I did no find how to associate the callbacks. The piece of not working code is:

            IntPtr tess = gl.NewTess();
            IntPtr pdata = gl.NewQuadric();
            gl.TessBeginPolygon(tess,pdata);
            gl.TessBeginContour(tess);
            gl.TessVertex(tess, new double[] { 1, 0, 0 }, new double[] { 0, 0, 0 });
            gl.TessVertex(tess, new double[] { 0, 0, 0 }, new double[] { 0, 0, 0 });
            gl.TessVertex(tess, new double[] { 0, 1, 0 }, new double[] { 0, 0, 0 });
            gl.TessVertex(tess, new double[] { 0.5, 0.5, 0 }, new double[] { 0, 0, 0 });
            gl.TessEndContour(tess);
            gl.TessEndPolygon(tess);

 

thanks in advance.

 

ps. Is there some piece of working code for tessellatio? I would really apreciate.

Dec 9, 2012 at 3:25 PM

um, you can send null data by gl.TessBeginPolygon(tess,Intptr.Zero);

but, sharpGL commented callback registration, i guess there may be some problems with that function...