TDPACK Examples


Example 1

Example 1 is meant to illustrate the use of the basic TDPACK routines. It includes all of the code necessary to draw the stereo picture above, showing two intersecting surfaces, rendered in different styles, enclosed in a box, with tick marks and labels on selected edges of the box.

On a system on which NCAR Graphics has been installed, you can obtain the code for this example, compile it, and execute it by typing the command "ncargex tdex01". This will create an NCAR Graphics metafile called "tdex01.ncgm".


Example 2

Example 2 is a figure that was used to illustrate a scientific article. The green sphere represents the earth, the red and blue rings elements from a model grid, and the narrow black cone a ray emanating from the center of the earth at a specific latitude and longitude. Note that the values of the internal parameters 'LSU', LSV', and 'LSW' have been changed to move the light source from the position of the eye to a point somewhere off to the left and that the value of the internal parameter 'SHD' has been changed to change the nature of the shading from double-light-source mode to single-light-source mode.

The reason that none of the objects in the figure casts a shadow on any of the others is that the shading algorithm is a simple one that does not use ray-tracing.

On a system on which NCAR Graphics has been installed, you can obtain the code for this example, compile it, and execute it by typing the command "ncargex tdex02". This will create an NCAR Graphics metafile called "tdex02.ncgm".


Example 3

Example 3 is meant to illustrate the use of the simplified-interface routines. It produces the following two frames, of which the first illustrates the use of TDEZ2D and the second illustrates the use of TDEZ3D:

(tdex03, frame 1)

(tdex03, frame 2)

On a system on which NCAR Graphics has been installed, you can obtain the code for this example, compile it, and execute it by typing the command "ncargex tdex03". This will create an NCAR Graphics metafile called "tdex03.ncgm".


C Example 1

C example 1 is meant to illustrate the use of the C interface to the basic TDPACK routines. It includes all of the code necessary to draw the stereo picture above, showing two intersecting surfaces, rendered in different styles, enclosed in a box, with tick marks and labels on selected edges of the box. There are also three marks (in red) and some labels.

On a system on which NCAR Graphics has been installed, you can obtain the code for this example, compile it, and execute it by typing the command "ncargex c_tdex01". This will create an NCAR Graphics metafile called "c_tdex01.ncgm".


TDPACK Demo

The TDPACK demo is a program that allows one to investigate the capabilities of TDPACK in an interactive manner. On a system on which NCAR Graphics has been installed, simply execute the command

  tdpackdemo

This will create an X window containing an initial display of a simple surface. Commands may then be typed in the original window, directing the demo program to change the X-window display in various ways. A little experimentation should suffice to learn what is possible; a good place to start is with an "H" command, which will give you a list of all the possible commands.

The code of the TDPACK demo program may be viewed here.