Terrain demo

This demo flies over a terrain.

How to run the demo

This demo requires a two-dimensional MT embedded in three dimensions, representing a scalar field (no two different z values for the same (x,y) pair), with approximation errors associated with its tiles.

Let the MT be contained in a file named xxx.mtf, tile errors be contained in file xxx.err. To run the demo, type:

For instance, try demo2 ../data/marcy128.

To exit the demo, strike key "Q" or "q" when the focus is in one of the demo windows.

Inside the demo

The program extracts a triangle mesh that, inside the view frustum, has an approximation errror decreasing with the distance from the viewpoint; outside the view frustum, the mesh is arbitrarily coarse. The extraction parameters are: The user can control the movement of the viewpoint, and change the extraction parameters.

Two windows are used for visualization:

A third window shows the available commmands for interacting with the program.

User interaction

User interaction is done by pressing the following keys when the mouse focus is in one of the three windows of the program.

Viewpoint movement

The directions of turns are referred to the current view direction.

Triangle mesh extraction

Drawing

Zooming only applies to the overview window.

Termination

Remarks

To avoid collision, the height of the viewpoint is dynamically changed based on the max height of the terrain in the current frame. For some pairs of frames, the max height changes suddently, thus causing the viewpoint to jump up or down.

Visualization in hidden wireframe in the eye window is slow because it makes use of stencil functions.