X-ray mode
This is the part I said I was actually here for. Flip a switch and the wooden case turns to glass so you can see what’s been sealed inside the whole time. Getting it to look right was the fun part. Getting it to stay working cost me the better part of an afternoon.
What I built
- Case → glass. The casing shells (body, rotor housing, plugboard panel) drop to ~28% opacity with depth-writing turned off, so you can see straight through the wood.
- A lit interior. A warm point light kicks on inside the case the moment X-ray turns on — otherwise the guts just read as a dark smudge instead of actual hardware.
- The hidden hardware. Built everything that’s normally sealed away: a battery block with brass terminals, and thick orange cable looms routing down beneath the rotors.
- The wiring map. A 26-strand bundle draws the actual internal permutation for the current rotor / ring / position setup, so what you see under the glass matches what the engine is really doing.
Then it went dark — on a fresh load only
Everything looked perfect while I was building it. Then I cleared the cache, cold-booted the dev server to check it clean… and X-ray did nothing. Solid wood. The button highlighted, the wiring was clearly toggling on, the opacity was being set — and the case flat-out refused to turn transparent. I burned a good while convinced a git reset had eaten the fix.
The one-line culprit
It wasn’t git — the code was byte-for-byte the version I’d already signed off on. The real reason: in three.js (r137+), if you flip a material’s transparent flag at runtime, the change won’t take effect unless you also set material.needsUpdate = true. My toggle was setting transparent and opacity but never needsUpdate, so blending never actually switched on and opacity = 0.28 was silently ignored. It “worked” during development purely because hot-reload kept rebuilding the materials from scratch — a real cold load exposed it instantly. One line in the toggle loop and the glass came back.
Next up: make the current actually flow — each keypress lighting up the live signal path through the rotors and off the reflector, with a real cable running from the key you pressed into the loom, so the glow starts where your finger does.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.