I'll build a mobile-optimized 3D sculpting web app using Three.js. Let me plan the architecture:
- Three.js for rendering with a subdivided icosphere as the starting object
- Sculpting engine with tools: Draw, Inflate, Smooth, Grab, Pinch, Flatten, Crease, Paint
- Touch controls: 1 finger sculpts, 2 fingers orbit/pinch-zoom
- UI: Bottom toolbar (thumb-friendly), collapsible side panel for brush settings & colors
- Features: Symmetry (X mirror), undo, save PNG, remesh subdivide, wireframe toggle
Let me create the files:
Now the sculpting engine — the core Three.js logic:
Now the React App with UI and input handling:
Build succeeded. Let me add a small missing utility CSS class:
Let me verify the build still works and quickly sanity-check the app is complete:
Build succeeds. Here's what I built:
Sculpt3D — Mobile 3D Sculpting Web App
Architecture
src/sculpt/engine.ts — Three.js sculpting engine: manages the mesh (welded icosphere), camera orbit, raycasting, brush ring indicator, per-vertex colors, undo history (20-step), neighbor connectivity for smoothing, and midpoint subdivision.
src/App.tsx — React UI + pointer/touch input handling.
Sculpting Tools (Blender-style)
- ✏️ Draw — push surface out along face normal
- 🎈 Inflate — push along vertex normals
- 📐 Crease — sharp inward crease w/ pinch
- 🤏 Pinch — pull vertices together
- 🪓 Flatten — project vertices onto brush plane
- 💧 Smooth — Laplacian smoothing using vertex neighbors
- ✊ Grab — move a region with the cursor (captures original positions, applies smooth-falloff offset)
- 🎨 Paint — blend vertex colors
Each tool uses a smoothstep falloff and supports Invert (push inward). X-axis symmetry mirrors strokes.
Mobile Optimizations
touch-action: none + PointerEvents for unified touch/mouse
- 1 finger = sculpt, 2 fingers = orbit + pinch-zoom (with mid-stroke cancel)
- Auto-cancel active stroke when a 2nd finger lands
- Pixel ratio capped at 2, antialias only on low-DPR devices
- Thumb-friendly bottom toolbar (scrollable), collapsible panels, big touch targets
- Starting sphere ~2500 tris (fast), user can hit Subdivide for more detail on demand
Additional Features
- Vertex-color material with real-time lighting (hemi + key + rim)
- Wireframe overlay toggle
- Reset view / reset sculpt
- Save render as PNG
- Fill entire mesh with active color
- Live tri/vert counter
- Welcome overlay with controls
- Desktop: left-drag sculpt · right-drag orbit · wheel zoom
The start object is a subdivided icosphere (welded vertices so smoothing / topology-aware tools work correctly).
Files built: index.html, src/index.css, src/sculpt/engine.ts, src/App.tsx