by Aaron » Mon Jun 22, 2009 1:45 pm
Hi Therry,
I vaguely recall answering this in an e-mail. My usual reply to queries about tunnelling in L3DT goes something like:
L3DT is a heightfield generator, and tunnels cannot be implemented with heightfields*. Heightfields can only represent a surface, and that surface has to consist of a regular grid of points with unique vertical displacements. Tunnels cannot be represented in this data structure, as they have irregular point spacing and are not single-valued in general. Tunnels are complex 3D objects that need to be modelled properly in 3D (i.e. not using heightfields).
Tunnels in game environments are usually generated as a mesh object using a 3D mesh editor** such as Blender. For rendering in a game engine, the used is to cut out a region of the heightfield at the tunnel entrance and replace it with the opening to your tunnel mesh.
By the way, what game engine are you using, how does it load / display tunnels? What file format is used for tunnel maps?
Best regards,
Aaron.
* Any hacks to make tunnels with heightfields, such as using multiple heightfields (one for the tunnel ceiling, one for the floor), are imperfect and unwieldy at best. Consequently, few renderers support these approaches.
** L3DT/Sapphire don't count as 3D mesh editors. They are 3D heightfield editors, which is a significant difference when you're talking about complex geometry like tunnels.