1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
|
.\" Copyright (c) 1994 The Board of Trustees of The Leland Stanford
.\" Junior University. All rights reserved.
.\"
.\" Permission to use, copy, modify and distribute this software and its
.\" documentation for any purpose is hereby granted without fee, provided
.\" that the above copyright notice and this permission notice appear in
.\" all copies of this software and that you do not sell the software.
.\" Commercial licensing is available by contacting the author.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
.\" EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
.\" WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
.\"
.\" Author:
.\" Phil Lacroute
.\" Computer Systems Laboratory
.\" Electrical Engineering Dept.
.\" Stanford University
.\"
.\" $Date: 1994/12/31 19:49:53 $
.\" $Revision: 1.1 $
.\"
.\" Macros
.\" .FS <type> -- function start
.\" <type> is return type of function
.\" name and arguments follow on next line
.de FS
.PD 0v
.PP
\\$1
.HP 8
..
.\" .FA -- function arguments
.\" one argument declaration follows on next line
.de FA
.IP " " 4
..
.\" .FE -- function end
.\" end of function declaration
.de FE
.PD
..
.\" .DS -- display start
.de DS
.IP " " 4
..
.\" .DE -- display done
.de DE
.LP
..
.TH vpRotate 3 "" VolPack
.SH NAME
vpRotate \- multiply the current transformation matrix by a
rotation matrix
.SH SYNOPSIS
#include <volpack.h>
.sp
.FS vpResult
\fBvpRotate(\fIvpc, axis, degrees\fB)\fR
.FA
vpContext \fI*vpc;\fR
.FA
int \fIaxis;\fR
.FA
double \fIdegrees;\fR
.FE
.SH ARGUMENTS
.IP \fIvpc\fR
VolPack context from \fBvpCreateContext.\fR
.IP \fIaxis\fR
Rotation axis code (VP_X_AXIS, VP_Y_AXIS or VP_Z_AXIS).
.IP \fIdegrees\fR
Number of degrees to rotate.
.SH DESCRIPTION
\fBvpRotate\fR is used to multiply the current transformation
matrix by a 4-by-4 rotation matrix. The rotation axis must be one of
the three principal viewing axes and is specified with one of the
following codes:
.DA
.ta 15
VP_X_AXIS X axis
.br
VP_Y_AXIS Y axis
.br
VP_Z_AXIS Z axis
.DE
The rotation angle is specified in degrees. A positive angle
indicates a clockwise rotation when looking towards the positive
direction along the axis. For an X-axis rotation, the rotation matrix
is:
.DS
.ta 4C 12C 20C 28C
1 0 0 0
.br
0 cos(d) sin(d) 0
.br
0 -sin(d) cos(d) 0
.br
0 0 0 1
.DE
where d stands for the \fIdegrees\fR argument. For a Y-axis rotation,
the rotation matrix is:
.DS
.ta 4C 12C 20C 28C
cos(d) 0 -sin(d) 0
.br
0 1 0 0
.br
sin(d) 0 cos(d) 0
.br
0 0 0 1
.DE
For a Z-axis rotation, the rotation matrix is:
.DS
.ta 4C 12C 20C 28C
cos(d) sin(d) 0 0
.br
-sin(d) cos(d) 0 0
.br
0 0 1 0
.br
0 0 0 1
.DE
.PP
Use \fBvpCurrentMatrix\fR to
set the current transformation matrix. By default, the rotation
matrix is post-multiplied (M = M*R where M is the current matrix and R
is the rotation matrix). The VP_CONCAT_MODE option to \fBvpSeti\fR
can be used to select pre-multiplication.
.SH "STATE VARIABLES"
The current matrix concatenation parameters can be retrieved with the
following state variable codes (see vpGeti(3)): VP_CURRENT_MATRIX,
VP_CONCAT_MODE.
.SH ERRORS
The normal return value is VP_OK. The following error return value is
possible:
.IP VPERROR_BAD_OPTION
The \fIaxis\fR argument is invalid.
.SH SEE ALSO
VolPack(3), vpCreateContext(3), vpCurrentMatrix(3)
|