1SET3(3NCARG) NCAR GRAPHICS SET3(3NCARG)
2
3
4
6 SET3 - Defines the transformation from three dimensions to two
7 dimensions.
8
10 CALL SET3 (XMIN,XMAX,YMIN,YMAX,UMIN,UMAX,VMIN,VMAX,WMIN,WMAX,PEYE)
11
13 #include <ncarg/ncargC.h>
14
15 void c_set3 (float xmin, float xmax, float ymin, float ymax,
16 float umin, float umax, float vmin, float vmax, float wmin,
17 float wmax, float peye[3])
18
20 XMIN,XMAX,YMIN,YMAX
21 (input expressions of type REAL) are the fractional
22 coordinates (in NDCs) defining the portion of the plotter
23 frame (the "viewport") into which 3-D objects are to be
24 projected. Each has a value between 0. and 1., inclusive.
25 Examples: To use the whole plotter frame, set XMIN=0.,
26 XMAX=1., YMIN=0., and YMAX=1.; to use the upper left
27 quarter of the plotter frame, set XMIN=0., XMAX=.5,
28 YMIN=.5, and YMAX=1.
29
30 UMIN,UMAX,VMIN,VMAX,WMIN,WMAX
31 (input expressions of type REAL) are the limiting
32 coordinates, in a 3-D coordinate space of the user's
33 choosing, of the rectangular box that is to be projected.
34 This box normally contains all of the objects whose
35 projections are to be drawn.
36
37 PEYE (an input array, dimensioned 3, of type REAL) is an array
38 specifying the coordinates, in the user's 3-D coordinate
39 system, of the eye position. The point
40
41 (PEYE(1),PEYE(2),PEYE(3))
42
43 must be outside the box defined by UMIN, UMAX, VMIN, VMAX,
44 WMIN, and WMAX. Objects will be drawn as they appear from
45 this point.
46
47 The call to SET3 says what portion of the 3-D coordinate system is to
48 be projected, from what point it is to be projected, and where the
49 resulting picture is to be placed on the plotter frame.
50
51 The array PEYE specifies the position of the eye, which may be referred
52 to as the "viewpoint" or "center" of the projection.
53
54 The "line of sight" runs from the point
55
56 (PEYE(1),PEYE(2),PEYE(3))
57
58 (the eye position) to the point
59
60 (.5*(UMIN+UMAX),.5*(VMIN+VMAX),.5*(WMIN+WMAX))
61
62 (the point at the center of the projected box).
63
64 The "image plane" is perpendicular to the line of sight and may be
65 thought of as passing through the center of the box. The projection of
66 an arbitrary point P in 3-space is the point where the straight line
67 from the eye position to P passes through the image plane. The
68 projection of a more complicated object is just the union of the
69 projections of its constituent points.
70
71 The projection in the image plane of the box specified by the arguments
72 UMIN, UMAX, VMIN, VMAX, WMIN, and WMAX will be scaled to fit in the
73 viewport specified by the arguments XMIN, XMAX, YMIN, and YMAX. The
74 projected box will retain its natural aspect ratio; typically, it will
75 just touch the left and right edges of the viewport, or the top and
76 bottom of the viewport, but not both.
77
78 The image of the box will be rotated so that the projection of a unit
79 vector based at the center of the box and pointing in the direction of
80 the positive W axis will be made to point upward in the viewport.
81 However, if the line of sight is very nearly parallel to the W axis, so
82 that the projection of this unit vector shrinks almost to a point, then
83 a unit vector based at the center of the box and pointing in the
84 direction of the positive V axis will be made to point upward in the
85 viewport instead. One implication of this is that, if you are making a
86 movie by letting the eye "fly around" the objects being projected and
87 it gets too close to being directly above or below the center of the
88 box, there may be a sudden disconcerting rotation of the projected
89 image.
90
92 The C-binding argument descriptions are the same as the FORTRAN
93 argument descriptions.
94
96 SET3 should be called before calling other THREED routines.
97
99 Use the ncargex command to see the following relevant examples: tpwrzt,
100 tthree.
101
103 To use SET3 or c_set3, load the NCAR Graphics libraries ncarg,
104 ncarg_gks, and ncarg_c, preferably in that order.
105
107 Online: threed, curve3, fence3, frst3, line3, perim3, point3, psym3,
108 pwrz, pwrzt, threed, tick3, tick43, vect3, ncarg_cbind.
109
110 Hardcopy: NCAR Graphics Fundamentals, UNIX Version
111
113 Copyright (C) 1987-2009
114 University Corporation for Atmospheric Research
115 The use of this Software is governed by a License Agreement.
116
117
118
119UNIX March 1993 SET3(3NCARG)