re: [Actc-devel] Setting a Triangle Angle Tolerance in strip algorith
Status: Beta
Brought to you by:
grantham
|
From: Brad G. <gra...@ta...> - 2001-01-05 06:10:31
|
Forwarded message: > I'm new to this list so first off a BIG HOWDY!!! I believe yours is is actually the second message ever sent to the list. > Second off, a HUGE note of thanks to Brad Grantham for his excellent work. Thanks. > I was wondering if anyone had put in an angle tolerance to be used when > determining the next triangle to choose in the strip. Basicly what I'm > looking for is a way to set the tolerance to something like 30 degrees So you basically want to force seams where the difference is large enough? What kind of data set do you have that would need this? Some modelers and modeling languages (e.g. VRML, although calling it a "modeling language" is giving it a complement) use a "crease angle" to force sharp edges (i.e. flat shading across an edge) between triangles. TC is not involved in any of that. Per-vertex normals and sharing edges is a result of triangles sharing vertex indices, which is already done when the data is passed to TC. If you really have a triangle set where one triangle is adjacent to two or more triangles (like the tail of a dart), and you want to choose the "best" one, then I imagine you and others desiring similar functionality might be well suited by the following: - Associate a value with a triangle (perhaps a void*) - Give "GetNextVert" a function which compares the values of two triangles and yields a floating point "suitability number". Something like "typedef float (*valCompareFunc)(void *v1, void *v2);" - Have "GetNextVert" run the comparison function between the current triangle and all the candidates, and choose the highest number. - For your case, the void* can point to the surface normal and the compare func would, say, find the angle between the normals and return -angle, so the triangle most "flat" compared to the current one is chosen. This would require some implementation in GetNextVert and in the triangle structures. -Brad -- Brad Grantham, gra...@pl..., http://plunk.org/~grantham/ |