Chopper altitude and a TriangularArray

Hi

I have a chopper flying above a terrain. The terrain is loaded “manually” with a TriangleArray.

I have chosen (0, 0, 1) as up-direction.

What I want: Given the (choppers) x,y coords, what is the altitude?

In hope of getting any hints I read a tutorial on terrain-following. It used a “picking” approach. Is this what I need?

I could handle it myself if I knew what triangle the chopper was above.

I’m not very experianced with java3d so please be careful with explanation-shorcuts. :slight_smile:

Are the triangles placed on a regular grid (e.g. generated from a heightmap)? Then picking is overkill in that case. In that case I could dig out the code from FlyingGuns that determines the height above terrain.

In case the terrain is just a trianglesoup, picking at least as a first approach is appropriate.

The terrain I’m loading happens to be in a grid, but the code could take any load of (x,y,z)-data and produce a nice terrain.

I would like to keep the code this general for future weird map-file-support. But if you think this makes it very much harder to implement the height-thing a can assume the terrain is in a grid.
Whats your recommenadion.

You must admit that its nice not to require the terrain-samples to be in a grid.