The "combine" or "combineData" callback is invoked to create a
new vertex when the algorithm detects an intersection, or wishes
to merge features. The vertex is defined as a linear combination
of up to 4 existing vertices, referenced by data[0..3]. The
coefficients of the linear combination are given by weight[0..3];
these weights always sum to 1.0. All vertex pointers are valid
even when some of the weights are zero.
static void SpliceMergeVertices( GLUtesselator *tess, GLUhalfEdge *e1,
GLUhalfEdge *e2 )
/*
* Two vertices with idential coordinates are combined into one.
* e1->Org is kept, while e2->Org is discarded.
*/
{
void *data[4] = { NULL, NULL, NULL, NULL };
GLfloat weights[4] = { 0.5, 0.5, 0.0, 0.0 };
data[0] = e1->Org->data;
data[1] = e2->Org->data;
CallCombine( tess, e1->Org, data, weights, FALSE );
if ( !__gl_meshSplice( e1, e2 ) ) longjmp(tess->env,1);
}
data WeightedProperties v =
WeightedProperties
(GLclampf, v)
(GLclampf, v)
(Maybe (GLclampf, v))
(Maybe (GLclampf, v))
Hi,
I've just written some code which uses 'tessellate' from Graphics.Rendering.OpenGL.GLU.Tessellation and whilst it works exactly as expected on simple data sets, it gives a bus error on larger ones (not that large - e.g. 150 points).
This might be a bug in my OS's glu implementation, but I'm also inclined to suspect a bug in all the peeks and pokes HOpenGL uses to handle the data for the callbacks. I don't actually use the callback data (I've set all the data to (0 :: Int) only because there is no storable instance for ()).
Does anyone have a success story with this function? Has anyone used it successfully on larger polygons?
Jules
_______________________________________________
HOpenGL mailing list
HOpenGL@haskell.org
http://www.haskell.org/mailman/listinfo/hopengl