1vpRotate(3) Library Functions Manual vpRotate(3)
2
3
4
6 vpRotate - multiply the current transformation matrix by a rotation
7 matrix
8
10 #include <volpack.h>
11
12 vpResult
13 vpRotate(vpc, axis, degrees)
14 vpContext *vpc;
15 int axis;
16 double degrees;
17
19 vpc VolPack context from vpCreateContext.
20
21 axis Rotation axis code (VP_X_AXIS, VP_Y_AXIS or VP_Z_AXIS).
22
23 degrees
24 Number of degrees to rotate.
25
27 vpRotate is used to multiply the current transformation matrix by a
28 4-by-4 rotation matrix. The rotation axis must be one of the three
29 principal viewing axes and is specified with one of the following
30 codes: VP_X_AXIS X axis
31 VP_Y_AXIS Y axis
32 VP_Z_AXIS Z axis The rotation angle is specified in degrees. A
33 positive angle indicates a clockwise rotation when looking towards the
34 positive direction along the axis. For an X-axis rotation, the rota‐
35 tion matrix is: 1 0 0 0
36 0 cos(d) sin(d) 0
37 0 -sin(d) cos(d) 0
38 0 0 0 1 where d stands for the degrees argument.
39 For a Y-axis rotation, the rotation matrix is:
40 cos(d) 0 -sin(d) 0
41 0 1 0 0
42 sin(d) 0 cos(d) 0
43 0 0 0 1 For a Z-axis rotation, the rotation
44 matrix is: cos(d) sin(d) 0 0
45 -sin(d) cos(d) 0 0
46 0 0 1 0
47 0 0 0 1
48
49 Use vpCurrentMatrix to set the current transformation matrix. By
50 default, the rotation matrix is post-multiplied (M = M*R where M is the
51 current matrix and R is the rotation matrix). The VP_CONCAT_MODE
52 option to vpSeti can be used to select pre-multiplication.
53
55 The current matrix concatenation parameters can be retrieved with the
56 following state variable codes (see vpGeti(3)): VP_CURRENT_MATRIX,
57 VP_CONCAT_MODE.
58
60 The normal return value is VP_OK. The following error return value is
61 possible:
62
63 VPERROR_BAD_OPTION
64 The axis argument is invalid.
65
67 VolPack(3), vpCreateContext(3), vpCurrentMatrix(3)
68
69
70
71VolPack vpRotate(3)