1vpCurrentMatrix(3) Library Functions Manual vpCurrentMatrix(3)
2
3
4
6 vpCurrentMatrix - choose the current transformation matrix
7
9 #include <volpack.h>
10
11 vpResult
12 vpCurrentMatrix(vpc, option)
13 vpContext *vpc;
14 int option;
15
17 vpc VolPack context from vpCreateContext.
18
19 option A code specifying one of the VolPack transformation matrices
20 (VP_MODEL, VP_VIEW or VP_PROJECT).
21
23 vpCurrentMatrix is used to choose the current transformation matrix.
24 The option parameter must be one of the following: VP_MODEL mod‐
25 eling transformation
26 VP_VIEW viewing transformation
27 VP_PROJECT projection transformation Subsequent calls to the matrix
28 transformation functions (vpIdentityMatrix, vpTranslate, vpRotate,
29 vpScale, vpMultMatrix and vpSetMatrix) are applied to the new current
30 transformation matrix.
31
32 Typically the modeling transformation is used to specify a transforma‐
33 tion from object coordinates to world coordinates. In object coordi‐
34 nates the volume data is located inside a unit cube centered at the
35 origin (corners at (-0.5, -0.5, -0.5) and (0.5, 0.5, 0.5)). The
36 default modeling transformation is the identity, so the volume is ini‐
37 tially located inside the unit cube in world coordinates. By default,
38 the current matrix is VP_MODEL. The modeling transformation is also
39 applied to light direction vectors (see vpSetLight(3)).
40
41 The viewing transformation is used for transforming world coordinates
42 into eye coordinates. In eye coordinates the viewer is looking down
43 the Z axis in the negative direction. The default value of the matrix
44 is also the identity, so the viewer is looking down the Z axis in world
45 coordinates as well. Typically this transformation matrix is used to
46 specify the location and direction of the viewer. It is also possible
47 to combine the modeling and viewing matrices (as in the OpenGL viewing
48 model), in which case you can store the composite transformation in
49 either the model or the view matrix set the other matrix to the iden‐
50 tity.
51
52 The projection transformation specifies the transformation from eye
53 coordinates to clip coordinates. In the clip coordinate system the
54 entire viewing frustum lies inside a cube defined by the planes X=1,
55 X=-1, Y=1, Y=-1, Z=1 and Z=-1. This transformation also specifies the
56 type of projection used to produce a 2D image. The 2D image is com‐
57 puted by projecting along the Z axis in the clip coordinate system and
58 then scaling in the X and Y dimensions to the final image size. The
59 routines vpWindow and vpWindowPHIGS are useful for computing projection
60 transformations.
61
63 The current transformation matrix code can be retrieved with the fol‐
64 lowing state variable codes (see vpGeti(3)): VP_CURRENT_MATRIX.
65
67 The normal return value is VP_OK. The following error return value is
68 possible:
69
70 VPERROR_BAD_OPTION
71 The option argument is invalid.
72
74 VolPack(3), vpCreateContext(3), vpGetMatrix(3)
75
76
77
78VolPack vpCurrentMatrix(3)