# shz_xmtrx_init_rotation

Source: https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation/

> Initializes XMTRX to a 3D rotation matrix of angle radians about the vector with the given components

```c
SHZ_INLINE void shz_xmtrx_init_rotation(float angle, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT;
```

Initializes XMTRX to a 3D rotation matrix of `angle` radians about the vector with the given components.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `angle` | `float` |  |
| `xAxis` | `float` |  |
| `yAxis` | `float` |  |
| `zAxis` | `float` |  |

## Returns

Nothing (`void`).

## Notes

- This routine works similarly to glRotatef() applied to an identitiy matrix. The given axis will automatically be normalized internally.

## Availability

- **C++ equivalent:** [`shz::xmtrx::init_rotation`](https://sh4zam.com/api/cpp/xmtrx/#init_rotation)
- **Type-generic form:** none
- **Back-ends:** SH4: dedicated SH4 implementation · SW: portable C · SPU: shared C implementation
- **Defined in:** [`sh4zam/shz_xmtrx.h:318`](https://github.com/gyrovorbis/sh4zam/blob/ba1e30c88d49df0311870b229e1dd860ef26c477/include/sh4zam/shz_xmtrx.h#L318)
- **Module:** [XMTRX](https://sh4zam.com/api/xmtrx/), section "Initialization"

## See also

[`shz_xmtrx_init_rotation_dir`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_dir/)
