Expand description
Transform factory functions
Every visual operation is a matrix. Compose them via multiplication. M_final = M_last * … * M_first (applied right to left).
Functions§
- compose_
2d - Compose two 2D transforms: result = a * b (b applied first)
- compose_
3d - Compose two 3D transforms: result = a * b (b applied first)
- ortho
- Orthographic projection: maps [l,r]×[b,t]×[n,f] → [-1,1]³
- perspective
- Perspective projection (fov_y in radians, aspect = width/height)
- rotate_
2d - 2D rotation (counter-clockwise, radians)
- rotate_
x - Rotation around X axis
- rotate_
y - Rotation around Y axis
- rotate_
z - Rotation around Z axis
- scale_
2d - 2D non-uniform scale
- scale_
2d_ uniform - 2D uniform scale
- scale_
3d - 3D non-uniform scale
- shear_
2d - 2D shear
- translate_
2d - 2D translation
- translate_
3d - 3D translation
- viewport
- Screen-space transform: NDC [-1,1]² → pixel [0,w)×[0,h)