How ranahafez/creative-composter-demo works
This is a browser-based 3D scene editor: users load or upload a parent model, add child models, select and transform scene objects, adjust transforms in a panel, reset the scene, and export the parent model as GLB. The graph separates the UI, scene setup and interaction, model/domain objects, and transform controls. Several core modules are indexed but not excerpted; their links are included only where the index or an excerpt supports them, and uncertain wiring is omitted.
Main entry points: SetupCanvas.tsx Canvas setup · SidePanel.tsx Editor panel · App.tsx App composition · ParentModel.ts Parent and child models
Components 16
Editor UI
- App composition
src/App.tsx - Canvas setup
src/components/SetupCanvas.tsx - Editor panel
src/components/SidePanel.tsx - Panel transform state
src/hooks/usePanelVal.tsx
Scene Runtime
- Scene context
src/scene/SceneContext.tsx - Scene and camera
src/scene/createScene.ts - Scene lighting
src/scene/lights.ts - Initial model loading
src/scene/loadSceneModels.ts - Pointer interaction
src/scene/sceneInteraction.ts
Model Domain
- Scene controller
src/lib/sceneController.ts - Parent and child models
src/lib/ParentModel.ts - 3D model loading
src/lib/Node3d.ts
Transform Controls
- Transform gizmo
src/lib/GizmoManager.ts
Other components
- Editor user
- GLB assets
public/models - GLTF export
Connections 28
- Editor user → App composition: uses editor
src/App.tsx - App composition → Canvas setup: renders canvas
src/App.tsx - App composition → Editor panel: renders panel
src/App.tsx - App composition → Panel transform state: syncs selection
src/App.tsx - App composition → Scene context: provides scene
src/App.tsx - Canvas setup → Scene and camera: creates scene
src/components/SetupCanvas.tsx - Scene and camera → Scene lighting: adds lighting
src/scene/createScene.ts - Canvas setup → Initial model loading: loads initial models
src/components/SetupCanvas.tsx - Canvas setup → Scene context: sets scene
src/components/SetupCanvas.tsx - Canvas setup → Pointer interaction: attaches input
src/components/SetupCanvas.tsx - Canvas setup → Transform gizmo: creates gizmo
src/components/SetupCanvas.tsx - Canvas setup → Scene controller: stores parent
src/components/SetupCanvas.tsx - Initial model loading → 3D model loading: loads model nodes
src/scene/loadSceneModels.ts - Initial model loading → Parent and child models: builds parent model
src/scene/loadSceneModels.ts - 3D model loading → GLB assets: loads GLB
src/lib/Node3d.ts - Pointer interaction → Scene controller: checks parent
src/scene/sceneInteraction.ts - Pointer interaction → Transform gizmo: attaches selection
src/scene/sceneInteraction.ts - Pointer interaction → Panel transform state: reports selection
src/scene/sceneInteraction.ts - Editor panel → Scene controller: resets scene
src/components/SidePanel.tsx - Editor panel → Scene context: reads scene
src/components/SidePanel.tsx - Editor panel → 3D model loading: loads uploads
src/components/SidePanel.tsx - Editor panel → Parent and child models: replaces parent
src/components/SidePanel.tsx - Editor panel → GLTF export: exports model
src/components/SidePanel.tsx - Editor panel → Panel transform state: updates transforms
src/components/SidePanel.tsx - Parent and child models → 3D model loading: wraps model node
src/lib/ParentModel.ts - Transform gizmo → Parent and child models: updates constraints
src/lib/GizmoManager.ts - Transform gizmo → 3D model loading: transforms selected node
src/lib/GizmoManager.ts - Scene controller → Parent and child models: resets parent and children
src/lib/sceneController.ts