I wanted to see if CSS float and inline slots inside an article can reserve room for lit Three.js polyhedra that slice right through the depth plane of the page, follow font-size reflow automatically, and keep every word selectable. Drag across words to select text, tilt the sheet, or adjust the font size.
Starting Three.js prose scene...
Editorial geometry · Issue 04
Typography that yields to solid light
Ordinary layout engines pack lines round floats without knowing anything about WebGL depth buffers. Because this article lives inside a drawable canvas, CSS computes the wrap around the empty circle on the left while Three.js draws a lit icosahedron centred on z = 0 so its front facets emerge from the paper and its back faces disappear behind it.
Changing the base font size forces every line break to shift. Reading each placeholder's untransformed layout offsets keeps every mesh anchored inside its opening even when text reflows or the whole sheet tilts toward you. Try dragging over these lines to select text directly across the tilted surface, or switch paper stock below.
Even an inline aperture travels inside the flow of a single sentence. Open the note to check hit testing right beside the spinning octahedron.
Note [1]: Untransformed layout offsets inside #prose-doc stay stable after updateElementGeometry() places the article in 3D space.
Show the code CSS float slots, layout-offset mesh sync and Three.js depth
Prose with CSS float and inline apertures. Empty .obj-slot elements reserve wrapping space in normal CSS flow alongside selectable text, a footnote button and a paper selector.
Measuring untransformed layout offsets. Walks offsetLeft and offsetTop relative to #prose-doc rather than getBoundingClientRect(), then rebuilds the plane when font size changes document height.
Interleaving meshes at z = 0. Parents both the prose plane and lit meshes under one rotating group so front halves render above text while rear halves sit occluded behind the paper.
How it works
This experiment rebuilds Yomotsu's 3D objects within prose (CodeGrid #12) using HTMLSurfaces from /lib/html3d.js.
The article stays ordinary HTML in the tray if HTML-in-canvas is missing, and moves into the Three.js canvas when WebGL texture upload is available.
Because Chromium applies updateElementGeometry() to the article element, calling getBoundingClientRect() on a slot inside the page returns transformed screen coordinates instead of layout coordinates on the sheet.
Instead, layoutBoxIn() sums offsetLeft and offsetTop up to #prose-doc, maps each slot centre onto the plane's local XY coordinates at z = 0, and updates PlaneGeometry height whenever font-size reflow changes offsetHeight (clearing surface.frame so hit testing matches the resized plane).
Live checks
These checks wait for a tap so the page keeps one WebGL context until requested. Each check runs inside its own isolated fixture on the test stage and retires its canvas afterwards.
Findings
Measured in Chrome Canary 161.0.8200.0 on 2026-12-04 at 412x915 (DPR 2.625, SwiftShader WebGL): all 6 live checks passed with zero JS errors, zero lost contexts, zero open snapshots and zero horizontal overflow on a 756x920 canvas (10.6 MB).
Changing font size reflowed the inline slot from offsetTop67px to 98px and document height from 139px to 208px, and the 3D mesh Y coordinate followed from -0.196 to -0.108 without drift.
Native Selection.toString() returned "Selectable" across the tilted HTML sheet, buttons hit at a 24 deg tilt via elementsFromPoint(168, 677), and reduced motion held spin at 0.00 rad while preserving the -20 deg tilt and 60x60px slot.