guRotate
Creates a modeling matrix for rotation around an arbitrary axis (fixed point)
#include <ultra64.h> /* gu.h */
void guRotate(Mtx *m, float a, float x, float y, float z);
None
Returns a modeling matrix to the structure indicated by m 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)
For a detailed explanation about the fixed-point format, see gSPMatrix. Floating-point is handled using the guRotateF function.
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.
The Mtx structure looks like this:
typedef long Mtx_t[4][4];
typedef union {
Mtx_t m;
long long int force_structure_alignment;
} Mtx;
gSPMatrix, guAlign, guAlignF, guPosition, guPositionF, guRotateF, guRotateRPY, guRotateRPYF, guScale, guScaleF, guTranslate, and guTranslateF
03/01/99 Completely rewritten.