A theatrical video projector is just a perspective camera run backwards: it casts a rectangular image outward instead of capturing one. If the projector isn't perfectly perpendicular to the screen, the cast image lands as a trapezoid — "keystone" distortion — because the far edge of the screen is farther from the lens than the near edge.
This sim renders each stage flat with the projector's own view-projection matrix, sampling the pattern texture through it (projective texture mapping) — exactly the technique used by real projection-mapping software (MadMapper, Resolume, TouchDesigner) to fit video onto irregular set geometry.
With correction OFF, the projector uses a simple look-at camera aimed at the screen's centre — any off-axis offset produces a visible trapezoid. With correction ON, the projector instead uses Robert Kooima's generalized (off-axis) perspective projection — the real algorithm behind CAVE displays and projector lens-shift, calibrated to the front flat's four corners (pa, pb, pc = bottom-left, bottom-right, top-left):
v_r = normalize(p_b - p_a) // screen right
v_u = normalize(p_c - p_a) // screen up
v_n = normalize(v_r × v_u) // screen normal
v_a = p_a - eye, v_b = p_b - eye, v_c = p_c - eye
d = -(v_a · v_n) // eye-to-plane distance
l = (v_r·v_a) · near / d, r = (v_r·v_b) · near / d
b = (v_u·v_a) · near / d, t = (v_u·v_c) · near / d
frustum(l, r, b, t, near, far) // asymmetric projection matrix
Because the frustum is built directly from the screen's own corners rather than from the camera's forward axis, the resulting image is always a perfect rectangle on that flat — no digital pre-warp needed, just an asymmetric (shifted) lens. This is why real projectors can sit off to the side of a stage and still throw a square image: the lens itself is decentred, the same maths as above.
The two side flats aren't part of the calibration rectangle, so even with correction ON they show the raw geometric fall-off of light across an irregular set — a reminder that a projector calibrated to one surface still distorts on any surface it wasn't calibrated for, which is exactly why large multi-surface stage installations use several networked projectors, each solving its own off-axis matrix.