CURRENT PROJECTS
loading
CATEGORIES AND POSTS
loading
overset
DEVELOPMENT LOG FOR JIM PALMER
Posted 09/04/2007 in flash


So I have a terrain map as a Plane::Mesh3D object in flash using the Papervision 3D greatness. The {x,y} on all the vertices as it's generated from the USGS Elevation data create 2 triangles in a perfect square. This means that we have lots of triangles that we don't need on the "flat" part of the terrain profile. What is comes down to is essentially simplifying the mesh by making the triangles in the "flats" larger so we don't waste resources.

This is nothing new and I couldn't imagine how many SIGGRAPH tech papers, PhD's and high school project papers have been written on this subject. Either way - was my turn to implement this.

I have several experiments using different algorithms. I started with what is called "edge decimation" which simply collapses an edge if shared by two triangles and if the two end vertices have a small delta in the Z-coordinate. This failed somewhat due to the limitations of the framework I was working with - the Plane -> Mesh3D object.

I settled doing a single vertex decimation which involves looking at a single vertex and the adjacent 4 triangles or 6 triangles and the "outside" vertices to get the delta on their Z-coordinate. If that delta Z was under a specific threshold I would essentially make all the "outside" vertices of the adjacent triangles the same as the original vertex which essentially destroys all 4 or 6 of the adjacent triangles and changes the geometry on the adjacent triangles of the 4 or 6 destroyed adjacent triangles. This is greatly efficient in the framework.

Here's an example. Click on the mesh to simplify it (it'll only allow simplification to happen once), and then hold the mouse down to rotate the mesh left and right. (A 275k .SWF with no pre-loader, patience...)

Controls are of course minimal and horrific at best - but this is simply a proof of concept I've been meaning to get out there. The example above goes from 6956 to 3895 Face3D objects in the Mesh with a single run and no recursion.
comments
loading
new comment
NAME
EMAIL ME ON UPDATES
EMAIL (hidden)
URL
MESSAGE TAGS ALLOWED: <code> <a> <pre class="code [tab4|tabX|inline|bash]"> <br>
PREVIEW COMMENT
TURING TEST
gravatar