Expand description
Per-frame camera state for the pinhole projection the renderer uses.
A Camera carries an f64 world position and an orthonormal
right / down / forward basis. Rendering happens in f32, so
[derive] narrows the basis once per frame and precomputes the four
view-frustum corner ray directions.
§Pinhole model
A pixel (px, py) maps to a ray direction
dir = (px - hx)·right + (py - hy)·down + hz·forwardwhere (hx, hy) is the projection centre in pixels and hz the
focal length. (hx, hy, hz) = (w/2, h/2, w/2) gives a 90° horizontal
field of view with square pixels. The same expression evaluated at
the four screen corners yields CameraState::corn.
Structs§
- Camera
State - Per-frame
f32camera state derived from aCamera+ the screen projection parameters.
Functions§
- derive
- Derive the per-frame
CameraStatefor anxres × yresframebuffer with projection centre(hx, hy)and focal lengthhz.