# shz_xmtrx_init_billboard_z

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

> Initializes XMTRX to the rotation about the Z axis that turns local +X toward eye, as seen from pos

```c
SHZ_INLINE void shz_xmtrx_init_billboard_z(shz_vec3_t pos, shz_vec3_t eye) SHZ_NOEXCEPT;
```

Initializes XMTRX to the rotation about the Z axis that turns local +X toward `eye`, as seen from `pos`.

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `pos` | `shz_vec3_t` | Position of the billboarded object, used only to compute the direction to `eye`. |
| `eye` | `shz_vec3_t` | Position to face, such as the camera eye, in the same space as `pos`. |

## Returns

Nothing (`void`).

## Details

Axial billboarding about Z: the direction from `pos` to `eye` is projected onto the XY plane, normalized, and passed to `shz_xmtrx_init_rotation_z_xy()`. A rotation about Z cannot move +Z, so the quad faces along local +X. Only the rotation is written; `pos` is used for the direction and is not applied as a translation.

## Notes

- If `eye` lies on the Z axis through `pos`, the facing direction is undefined and no rotation is applied, leaving local +X unrotated.

## Availability

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

## See also

[`shz_xmtrx_init_rotation_z_xy`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_rotation_z_xy/), [`shz_xmtrx_billboard_z`](https://sh4zam.com/api/xmtrx/shz_xmtrx_billboard_z/), [`shz_xmtrx_init_billboard_x`](https://sh4zam.com/api/xmtrx/shz_xmtrx_init_billboard_x/)
