guAlignF
# guAlignF [Function]

### Function

guAlignF

*Creates a modeling matrix for rotation around an arbitrary axis (aligned, floating-point)*

### Syntax

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

### Arguments

**mf**
- 4x4 matrix resulting from 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

This macro performs an alignment process (in which the arbitrary axis represented by the line passing through the origin and a point (**x**, **y**, **z**) is rotated so it points in the same direction as the negative Z axis), and then returns a modeling matrix to the structure indicated by **mf** for use in rotating by an angle of **a** degrees in the positive direction around this arbitrary axis. The result of calling this macro is the creation of a modeling matrix like the one shown below. Note that a unit matrix is returned when h = 0.

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

Fixed-point is handled using guAlign.

### 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.

### See also

guAlign, guRotate, guRotateF, guScale, guScaleF, guTranslate, and guTranslateF

### Revision history

03/01/99 Completely rewritten