1vpWindowPHIGS(3) Library Functions Manual vpWindowPHIGS(3)
2
3
4
6 vpWindowPHIGS - multiply the projection matrix by a PHIGS viewing
7 matrix
8
10 #include <volpack.h>
11
12 vpResult
13 vpWindowPHIGS(vpc, vrp, vpn, vup, prp, umin, umax, vmin, vmax, front,
14 back, projection_type)
15 vpContext *vpc;
16 vpVector3 vrp, vpn, vup;
17 vpVector3 prp;
18 double umin, umax, vmin, vmax, front, back;
19 int projection_type;
20
22 vpc VolPack context from vpCreateContext.
23
24 vrp Point specifying the view reference point.
25
26 vpn Vector specifying the view plane normal.
27
28 vup Vector specifying the view up vector.
29
30 prp Point specifying the projection reference point (in view refer‐
31 ence coordinates).
32
33 umin Left coordinate of clipping window (in view reference coordi‐
34 nates).
35
36 umax Right coordinate of clipping window (in view reference coordi‐
37 nates).
38
39 vmin Bottom coordinate of clipping window (in view reference coordi‐
40 nates).
41
42 vmax Top coordinate of clipping window (in view reference coordi‐
43 nates).
44
45 front Coordinate of the near depth clipping plane (in view reference
46 coordinates).
47
48 back Coordinate of the far depth clipping plane (in view reference
49 coordinates).
50
51 projection_type
52 Projection type code. Currently, must be VP_PARALLEL.
53
55 vpWindowPHIGS is used to multiply the current projection matrix by a
56 viewing and projection matrix specified by means of the PHIGS viewing
57 model. This model combines specification of the viewpoint, projection
58 and clipping parameters. The resulting matrix is stored in the projec‐
59 tion transformation matrix. Since both the view and the projection are
60 specified in this one matrix, normally the view transformation matrix
61 is not used in conjunction with vpWindowPHIGS (it should be set to the
62 identity). Currently, only parallel projections may be specified. For
63 an alternative view specification model, see vpWindow(3).
64
65 Assuming that the view transformation matrix is the identity, the
66 matrix produced by vpWindowPHIGS should transform world coordinates
67 into clip coordinates. This transformation is specified as follows.
68 First, the projection plane (called the view plane) is defined by a
69 point on the plane (the view reference point, vrp) and a vector normal
70 to the plane (the view plane normal, vpn). Next, a coordinate system
71 called the view reference coordinate (VRC) system is specified by means
72 of the view plane normal and the view up vector, vup. The origin of
73 VRC coordinates is the view reference point. The basis vectors of VRC
74 coordinates are: u = v cross n
75 v = the projection of vup parallel to vpn onto the view plane
76 n = vpn This coordinate system is used to specify the direction of pro‐
77 jection and the clipping window. The clipping window bounds in the
78 projection plane are given by umin, umax, vmin and vmax. The direction
79 of projection is the vector from the center of the clipping window to
80 the projection reference point (prp), which is also specified in VRC
81 coordinates. Finally, the front and back clipping planes are given by
82 n=front and n=back in VRC coordinates.
83
84 For a more detailed explanation of this view specification model, see
85 Computer Graphics: Principles and Practice by Foley, vanDam, Feiner and
86 Hughes.
87
89 The current matrix concatenation parameters can be retrieved with the
90 following state variable codes (see vpGeti(3)): VP_CONCAT_MODE.
91
93 The normal return value is VP_OK. The following error return values
94 are possible:
95
96 VPERROR_BAD_VALUE
97 The clipping plane coordinates are invalid (umin >= umax, etc.).
98
99 VPERROR_BAD_OPTION
100 The type argument is invalid.
101
102 VPERROR_SINGULAR
103 The vectors defining view reference coordinates are not mutually
104 orthogonal, or the projection reference point lies in the view
105 plane.
106
108 VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpWindow(3)
109
110
111
112VolPack vpWindowPHIGS(3)