[ODE] Dem and Heightfield

Justin Couch justin at vlc.com.au
Thu Aug 17 10:05:14 MST 2006

Tristan McMillan wrote:

> I was wondering if anyone has ever integrated DEM data with the
> dHeightfield class. As I'm trying to take .vrml data or .dem data from
> vtterrain and generate a heightfield of this?

Yes, and it takes quite a lot of work to do so. There's also a lot of 
other things to consider that are directly related to what you're doing 
with the application. For example, are you only rendering one DEM at a 
time, or are you doing some sort of dynamic terrain rendering algorithm 
(e.g. ROAM, CLOD) where you're paging in heights from a large collection 
of data.

Firstly real earth data is in double precision and represents values on 
the surface of the earth (ie non-local values). You need to end up 
generating a local origin and translate the earth-based values into a 
local reference frame. Effectively this reduces you from double to 
single precision values. It also brings numbers back into line with 
something that ODE can handle. The bigger numbers get away from 1.0, the 
less accurate ODE becomes.

The next problem is that, being real world elevation data, the origin is 
based on the lower left corner. ODE doesn't use that, so you'll also 
need to apply an extra set of offsets to translate into ODE's way of 
thinking. If you're doing dynamic terrain rendering, that's going to be 
a pretty major performance hit as you have to calculate these all every 
frame. The collision libraries down the bottom of ODE don't deal well 
with dynamically changing data. If you can do the collision detection 
outside of ODE, you'll get some significant performance increases (in 
one case we got an order of magnitude faster speed on the basic 
collision detection).

Justin Couch                         http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler              http://www.yumetech.com/
3D Java Graphics Information                    http://www.j3d.org/
"Look through the lens, and the light breaks down into many lights.
  Turn it or move it, and a new set of arrangements appears... is it
  a single light or many lights, lights that one must know how to
  distinguish, recognise and appreciate? Is it one light with many
  frames or one frame for many lights?"      -Subcomandante Marcos

More information about the ODE mailing list