[ODE] Creating a TriList heightmap geom

g.haussmann@att.net g.haussmann at att.net
Mon May 12 09:20:02 2003


> juhani honkala wrote:
>  > Would be nice to have a 'heightmap' geom or
> > something. I'm sure that would
> > be useful and poised to come quite popular, coz many
> > ppl are using tricollider for the landscape.
> > 
> > Maybe someone here has done a one already and would like to contribute it to
> > the community???

There is a dynamic heightfield <-> trilist builder at

http://nebuladevice.sourceforge.net/cgi-bin/twiki/view/Nebula/NCTerrainPackage

that builds on the ChunkLOD method of generating "chunks" of varying sizes
stored in a quadtree.  The triangle meshes approximate the underlying
heightfield, and deeper levels of the quadtree represent more accurate triangle
meshes.  The heightfield is pre-compiled into vertex data and OPCODE collision
trees; this compiled data is loaded in from disk dyanamically, so you can
represent pretty big streches of terrain.

I have this working with basic collision testing, but it is not yet
integrated with ODE; the demo on the page (which runs in The Nebula Device)
simply makes some toruses (torii?) scuttle over the terrain.  Also, you have
to decide what heuristic to use for loading in the more accurate collision
data.  I currently make the collision meshes mirror the rendered meshes, but
a more sophisticated method is probably needed when there are objects
flying around out of sight.

Gary