TDINIT(3NCARG) | NCAR GRAPHICS | TDINIT(3NCARG) |
TDINIT - Initialization routine for TDPACK, called to define the position of the eye, the position of the point looked at, which way is up, and whether or not a stereo view is to be done.
CALL TDINIT (UMID, VMID, WMID, UORI, VORI, WORI, UTHI, VTHI, WTHI, OTEP)
#include <ncarg/ncargC.h>
void c_tdinit(float umid, float vmid, float wmid, float uori, float vori, float wori, float uthi, float vthi, float wthi, float otep)
This initialization routine is called to define the position of the eye, the position of the point looked at, which way is up, and whether or not a stereo view is to be done. TDINIT precomputes some quantities in TDPACK common blocks that will subsequently be used in projecting points from 3-space (U, V, and W coordinates) to 2-space (X and Y coordinates).
By default (that is to say, if the internal parameter 'SET' has its default value), TDINIT also calls the SPPS routine SET to define the mapping from the "user" coordinate system (the X/Y system) to the "fractional" coordinate system (in GKS terms, NDC space). This is done in such a way as to show in the projection plane a field of view of 'FOV' degrees. The viewport to be used in the fractional coordinate system is that defined by the values of the internal parameters 'VPL', 'VPR', 'VPB', and 'VPT'. In some situations, it may be desirable, after calling TDINIT, to call the SPPS routine GETSET to retrieve the arguments with which TDINIT called SET and then recall SET with a different set of arguments.
Normally, the creation of an image with TDPACK starts with a call to TDINIT (perhaps preceded by calls to TDSETI, TDSETR, and/or TDSTRS to reset internal parameters of the package) and continues with calls to draw objects. (Of course, if all of the arguments in a call to TDINIT have the same values as in the last call and the SET call that was done as a result is still in effect, then it's not necessary to repeat the call to TDINIT.)
For stereo views, one calls TDINIT with a negative OTEP, executes the object-drawing calls, calls TDINIT again with a positive OTEP, and then repeats all of the object-drawing calls. The exact way in which stereo views are drawn is also affected (slightly) by the value of the internal parameter 'STE'.
The arguments of TDINIT are as follows:
OTEP = (+ or -) R *
TAN(.017453292519943*ANGD/2.)
where the constant (.01745...) is just pi/180 and ANGD is the desired difference in the angle between the two views, in degrees; use a value of about 1 or 2 degrees for ANGD.
Note that, if the origin is approximately in the middle of the objects being viewed, then it's probably appropriate to use a value of R computed as follows:
R = SQRT((UMID-UORI)**2
(VMID-VORI)**2+
(WMID-WORI)**2)
The C-binding argument descriptions are the same as the FORTRAN argument descriptions.
To use TDINIT or c_tdinit, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order.
Online: tdclrs, tdctri, tddtri, tdgeti, tdgetr, tdgrds, tdgrid, tdgtrs, tditri, tdlbla, tdlbls, tdline, tdlnpa, tdmtri, tdotri, tdpack, tdpack_params, tdpara, tdplch, tdprpa, tdprpi, tdprpt, tdseti, tdsetr, tdsort, tdstri, tdstrs
Copyright (C) 1987-2009
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
July 1997 | UNIX |