Loading the frame
โ† demo.grn.dk Blender 4.5 โ†’ glTF โ†’ three.js

Optik โ„–1

A pair of acetate spectacles modelled, rigged and animated in Blender, then exported as glTF and played back live. Pick a frame and lens, dial in a prescription, step into the sun. Drag to orbit, scroll to zoom.

Frame
Lens
Rx +0.00 D
โ€”
The same file, offline

Rendered in Cycles

Above is the real-time version. This is the same .blend rendered with Blender's path tracer: the parts fly together, the temples unfold, one full turn on the stand. Real glass lenses in front of a real eye chart, so the refraction is physically traced, not faked. Nothing here is a stock asset; the model, materials and keyframes come from one Python script.

Cycles, 1280ร—720, 48 samples + OpenImageDenoise, 8 sRendered on a 12-core CPU, no GPU
Cycles render of tortoiseshell spectacles on an acrylic stand, an eye chart behind, the letters bending through the lenses
Hero still, 1920ร—1080, 128 samples, AgX Punchy, ฦ’/2.8 depth of field
How it was made

One script, every step

The whole piece is a Blender pipeline you can re-run: geometry, materials, rigging, animation, export and render live in build_optics.py. For a real optician the procedural frame becomes the shop's own models (a CAD file or a scan of the actual frame) and the rest stays the same: same animation, same configurator, same film.

Modelling

Lens outline as a keystoned ellipse, rims and lenses lofted from it with bmesh; temples, bridge and pad arms swept along curves with a rounded section. All in real millimetres.

Lenses with shape keys

Each meniscus lens carries two shape keys, plus and minus. They export as glTF morph targets, so the Rx slider above changes the actual lens geometry: thick centre or thick edge.

Materials

Principled BSDF: procedural tortoiseshell acetate with a clear coat, glass lenses (transmission, IOR 1.52), silicone pads, acrylic stand, gold trim. The viewer swaps in black, crystal and gold variants at runtime.

Rigging and animation

Temples hang off hinge pivots, everything off a display pivot. Frames 1โ€“60 fly the parts together, 60โ€“100 unfold the temples, 100โ€“192 turn the stand once. One clip, played in both the film and the viewer.

Export

export_scene.gltf with the scene animation baked and morph targets on. 0.9 MB binary glTF, loads in well under a second.

Playback

three.js r185, self-hosted: PMREM room environment, soft shadows, AgX tone mapping, transmissive lenses over a real eye chart, photochromic tint eased in real time. No CDN, nothing to expire.

36objects
โ€”triangles in the viewer
ยฑ4 Dprescription range
โ€”glTF load time
For a store

Where this goes next