From Geoff Michel, "New delaunay triangulator attached. I hadn't realised that the erase() method was not erase (first, last) but erase (first, one after the last one you want deleted). This made a big difference; however some of the edges of the terrain were not included as edges in the terrain so I increased the size of the supertriangle, which works but reduces accuracy due to the larger range of coordinates in the supertriangle. (A larger supertriangle forces the triangles using supertriangle vertices to be long and thin, making the triangulation fit the convex hull of the terrain.)
From Geoff Michel, "New delaunay triangulator attached. I hadn't realised that the erase() method was not erase (first, last) but erase (first, one after the last one you want deleted). This made a big difference; however some of the edges of the terrain were not included as edges in the terrain so I increased the size of the supertriangle, which works but reduces accuracy due to the larger range of coordinates in the supertriangle. (A larger supertriangle forces the triangles using supertriangle vertices to be long and thin, making the triangulation fit the convex hull of the terrain.)

The loss of accuracy should not affect 'normal' users with terrains that are roughly square (say up to 100:1 aspect ratio) and where the Z range is comparable to the X-Y range. Retested with Pauls data, amalric's strange polygon constraint and the standard test constraints.

I also added 2 tests for routines with a NULL argument passed to them (no-one would usually pass a NULL pointer to these routines unless - as I did in testing- you remove some of the constraints but still pass their pointer to the routine). And I removed 3 tests for triangles which are already removed when generating the geometry.

NB Paul - the previous delaunay triangulator fails under VS8 IF it has any constraints as it attempts to use some vertices that have already been deleted when applying the constraints to edges. Under VS6 and less rigorous compilers it works as the deleted vertices are still in the points stl::Vector; however any added vertices would replace one of the supertriangle vertices with non-disastrous but wrong results."

Note, merged with latest name changes in CVS.


marchelbling/osg,jtorresfabra/osg,openscenegraph/osg,artoolkit/osg,marchelbling/osg,tomasthoresen/osg,marchelbling/osg,scrawl/osg,scrawl/osg,openscenegraph/osg,openscenegraph/osg,scrawl/osg,tomasthoresen/osg,jtorresfabra/osg,artoolkit/osg,artoolkit/osg,scrawl/osg,artoolkit/osg,marchelbling/osg,tomasthoresen/osg,jtorresfabra/osg,jtorresfabra/osg,tomasthoresen/osg,openscenegraph/osg