WebGL Modeler
A small 3D modeler that runs in your browser. I built it to learn how mesh editing works under the hood, not by calling a library, but by wiring up a half-edge data structure by hand.
Best on a desktop with a keyboard and mouse. Add a primitive from the panel, pick a selection mode with 1 / 2 / 3, click something, then press a tool key. Left click or Enter confirms; right click or Esc cancels.
Blender-style, keyboard-driven
Move
Move a whole object, optionally locked to an axis with X / Y / Z.
Extrude
Push a face in or out, or grow a spike from a single vertex.
Scale
Resize a face or edge around its center, with axis constraints.
Loop Cut
Slice a ring of edges around a strip of quads.
Bevel
Turn a sharp edge into a small flat chamfer.
Undo / Redo
Works across every tool, with up to 100 steps of history.
You can also type exact values mid-drag: press E, type -0.5, hit Enter, and the face goes in by half a unit. The camera has Blender’s numpad view presets, and the panel handles primitives, OBJ import and export, and wireframe display.
How it's built
Every face is a single triangle in a half-edge mesh. A “quad” on a cube is two triangles sharing a diagonal, and the editor groups coplanar triangles back together so clicking a cube face selects the whole square. Loop Cut is built on top of that, defining a quad as exactly two triangles with a clean four-edge boundary.
Each tool is split in two on purpose. The topology module does the half-edge math and knows nothing about the mouse; the tool class handles keyboard and pointer input and knows nothing about half-edges. That split keeps the topology code testable on its own.
Bugs that were fun to find
The invisible twin
Cancelling an extrude deleted the new wall geometry but left the neighboring face pointing at it. The mesh still passed validation because the broken pair was consistent with itself.
The whisker that never showed up
A vertex extrude built two triangles whose third corner sat exactly on another corner, so both had zero area and could never render.
Undo that merged two vertices
Extruding by zero, confirming, undoing and redoing merged two distinct vertices at the same position. The fix was a second import path that skips merging.
Delete broke rendering silently
Removing vertices left gaps in the ID numbering, so a surviving vertex could write past the end of the position buffer. Nothing errored; the geometry just came out wrong.
Known limitations
This is a learning project, not a Blender replacement. Some honest gaps:
- One selection at a time, with no multi-select
- Bevel is a single flat chamfer on interior edges
- Loop Cut always cuts at the midpoint, one cut at a time
- OBJ only, with no materials or colors
- Undo stores whole-scene snapshots, which suits small scenes
Want to talk about it?
Happy to walk through the half-edge design or anything else I've built.