# shz_xmtrx_apply_perspective

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

```c
SHZ_INLINE void shz_xmtrx_apply_perspective(float fov, float aspect, float znear) SHZ_NOEXCEPT;
```

Multiplies and accumulates the perspective matrix constructed from the given values onto XMTRX.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `fov` | `float` |  |
| `aspect` | `float` |  |
| `znear` | `float` |  |

## Returns

Nothing (`void`).

## Details

| fr\[n + 0\] | fr\[n + 4\] | fr\[n + 8\] | fr\[n + 12\] |
| --- | --- | --- | --- |
| cot(f)/a | 0.0f | 0.0f | 0.0f |
| 0.0f | cot(f) | 0.0f | 0.0f |
| 0.0f | 0.0f | 0.0f | nz |
| 0.0f | 0.0f | -1.0f | 0.0f |

## Availability

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