guRotateF

guRotateF [Function]

Function

guRotateF

Creates a modeling matrix for rotation around an arbitrary axis (floating point)

Syntax

#include <ultra64.h>        /* gu.h */
void guRotateF(float mf[4][4], float a, float x, float y, float z);

Arguments

mf
The matrix resulting from the calculation
a
Angle of rotation (in degrees) around an arbitrary axis
x
x component of axis of rotation
y
y component of axis of rotation
z
z component of axis of rotation

Returned value

None.

Description

Returns a modeling matrix to mf for use in rotating around the arbitrary axis represented by the line passing through the origin and a point (x, y, z) by an amount of a degrees in the positive direction. When this function is called, the result is the creation of the following kind of modeling matrix:


(* Note that the values (x,y,z) here are normalized inside the function)

Fixed point is handled with the guRotate function.

Note

The vector does not have to be normalized ahead of time. This is done inside the function. However, when = 0 the operation of this macro cannot be guaranteed. Also, note that an angle with a positive value represents counter-clockwise rotation.

See Also

guAlign, guAlignF, guPosition, guPositionF, guRotate, guRotateRPY, guRotateRPYF, guScale, guScaleF, guTranslate, and guTranslateF

Revision History

03/01/99 Completely rewritten.