.\" 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 -- function start .\" 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 .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)