One True Angle
Three thousand cubes that look like rubble from every direction but one, where they line up into a letter.
What it is
A cloud of cubes floating in the dark. Drag to look around. From almost everywhere it’s rubble, but there’s exactly one direction where it collapses into a letter, and when you find it a bell rings. Press N for another.
How it works
Under an orthographic camera, sliding a point along the direction the camera looks can’t change where it lands on screen. That’s the whole trick, and it means the puzzle never has to be solved, only constructed.
So: pick a secret direction, rasterise a fat letter to an offscreen canvas, sample three thousand points inside it, and place a cube at each one pushed a random distance along that secret direction. From the secret direction every cube projects exactly onto the letter. From anywhere else they’re strung out in depth and read as junk.
Orthographic matters. Under perspective you’d have to scale each point along its own view ray instead, and the guarantee stops being exact.
The difficulty is one number. Smear from an off-angle view is roughly the depth spread times the sine of the angle, so the spread and the tolerance for “found it” have to be chosen together. Too little spread and the letter stays readable from angles that are meant to be wrong.
What surprised me
Two bugs, both invisible in the maths and obvious on screen.
The first: my view basis computed up as right × forward, which points down and makes the
basis left-handed. Every unit test passed, because the vectors were still perpendicular and
still unit length. BUT feeding a left-handed basis to three’s setFromRotationMatrix produces a
reflection rather than a rotation, and every cube rendered as a collapsed sliver.
Orthonormality isn’t handedness, and I was only testing the first one.
The second: the letters came out mirrored. A three camera placed at -forward × distance and
aimed at the origin ends up with screen-right equal to minus the basis’s right vector, so a
sculpture built with +u renders backwards. Easy to fix, impossible to notice with a symmetric
test glyph. “8” looks fine mirrored. “R” doesn’t.
What I would do next
Whole words instead of single letters, so the reveal reads as a message.