prashant joshi

Case study · 2022 · JavaScript, three.js

A 3D editor where every object brings its own controls

Project: graphicsAI 3D Editor · live

Team: graphicsAI was a three-person project.

The problem

We wanted a 3D scene editor that runs in the browser with no install. Users should be able to add primitives, lights and cameras, change any parameter live, move things with gizmos, and export the result. Every new object type multiplies the UI work, so the design had to keep that cost from growing.

The design: object + helper + property controller

Each object type is made of three pieces:

A shared base PropertyController provides visibility, selection, the transform folder and delete. Subclasses add only what is specific to them: segments for a box, angle and penumbra for a spotlight, arms and spin for the galaxy. An ObjectGenerator maps object types to their controllers and registers each new object in the scene outliner.

Result:

Delivery

Trade-offs and what I’d change

Choice Benefit Cost Today
dat.gui as the UI Every property becomes a control in one line Limited UX and styling A real component UI (React + a small state store) generated from the same property schema
Inheritance-based controllers Quick to add types Deep hierarchies; logic split across helper and controller Declarative property schemas per type; composition over inheritance
CI commits the built bundle to the repo Pages “just works” Noisy history (bot commits), large repo Deploy build artifacts with Pages actions, never commit dist/
No tests Speed in a student project Regressions were caught by hand Unit-test controllers (property → three.js state), plus a visual smoke test

What it taught me