1vpWindow(3) Library Functions Manual vpWindow(3)
2
3
4
6 vpWindow - multiply the projection matrix by a perspective or ortho‐
7 graphic matrix
8
10 #include <volpack.h>
11
12 vpResult
13 vpWindow(vpc, type, left, right, bottom, top, near, far)
14 vpContext *vpc;
15 int type;
16 double left, right;
17 double bottom, top;
18 double near, far;
19
21 vpc VolPack context from vpCreateContext.
22
23 type Projection type code. Currently, must be VP_PARALLEL.
24
25 left Coordinate of the left vertical clipping plane.
26
27 right Coordinate of the right vertical clipping plane.
28
29 bottom Coordinate of the bottom horizontal clipping plane.
30
31 top Coordinate of the top horizontal clipping plane.
32
33 near Coordinate of the near depth clipping plane.
34
35 far Coordinate of the far depth clipping plane.
36
38 vpWindow is used to multiply the current projection matrix by a per‐
39 spective or orthographic projection matrix. The new projection matrix
40 is defined by the coordinates of six clipping planes in the eye coordi‐
41 nate system (see vpCurrentMatrix(3)). The matrix maps the points
42 (left, bottom, near) and (right, top, near) to the lower left and upper
43 right corners of the clipping window. For an alternative means of
44 specifying the projection matrix, see vpWindowPHIGS(3).
45
46 Currently, only orthographic projections are supported. Perspective
47 projections will be added in a future release.
48
49 The matrix for parallel projections is: A 0 0 D
50 0 B 0 E
51 0 0 C F
52 0 0 0 1
53
54 A = 2 / (right - left)
55 B = 2 / (top - bottom)
56 C = 2 / (far - near)
57 D = (left + right) / (left - right)
58 E = (bottom + top) / (bottom - top)
59 F = (near + far) / (near - far) The matrix is multiplied into the pro‐
60 jection matrix, even if the projection matrix is not the current
61 matrix. By default, the matrix is post-multiplied (N = N*m where N
62 is the current matrix and m is the argument to vpMultMatrix). The
63 VP_CONCAT_MODE option to vpSeti can be used to select pre-multiplica‐
64 tion. The default window is a parallel projection with left = bottom =
65 near = -0.5, and right = top = far = 0.5.
66
68 The current matrix concatenation parameters can be retrieved with the
69 following state variable codes (see vpGeti(3)): VP_CONCAT_MODE.
70
72 The normal return value is VP_OK. The following error return values
73 are possible:
74
75 VPERROR_BAD_VALUE
76 The clipping plane coordinates are invalid (left >= right,
77 etc.).
78
79 VPERROR_BAD_OPTION
80 The type argument is invalid.
81
83 VolPack(3), vpCreateContext(3), vpCurrentMatrix(3), vpWindowPHIGS(3)
84
85
86
87VolPack vpWindow(3)