Commit Graph

11 Commits

Author SHA1 Message Date
m
32eaf70635 Add catalog sidebar panel with categories, search, and click-to-place 2026-02-07 12:27:11 +01:00
m
e10abf4cf3 Add preserveDrawingBuffer for reliable PNG screenshot export
Without this flag, toDataURL() on the WebGL canvas can return blank
in some browsers because the drawing buffer gets cleared.
2026-02-07 12:26:30 +01:00
m
4d4d5f947b Add JSON save/load and PNG screenshot export
- ExportManager with JSON export (toJSON + timestamp), import with
  file picker and validation, and high-res PNG screenshot capture
- Save/Load/Screenshot buttons in sidebar
- Ctrl+S keyboard shortcut for quick save
- Design load event updates info bar
2026-02-07 12:26:05 +01:00
m
08248c6cad Add theme system with 5 presets and selector UI
- 5 themes: Standard, Modern, Warm, Dark, Scandinavian
- ThemeManager mutates shared COLORS, clears cache, re-renders
- Updates scene background and light intensities per theme
- Theme selector buttons with color swatch in sidebar
- Exported COLORS from renderer.js for theme access
2026-02-07 12:24:58 +01:00
m
c0368f9f01 Add drag-to-move furniture with grid snapping and room bounds
- Pointer down on selected furniture starts drag mode
- OrbitControls disabled during drag
- Floor plane (Y=0) raycasting for cursor projection
- Drag offset preserves grab point (no cursor jump)
- Grid snapping at 0.25m intervals (configurable)
- Room bounds constraint keeps furniture inside walls
- On pointer up, commits new position to DesignState
- Wall-mounted items excluded from drag
2026-02-07 12:23:27 +01:00
m
d0d9deb03a Add InteractionManager with mode system, selection outline, keyboard shortcuts
- Mode system: view | select | move | rotate | place
- Click furniture to select with cyan wireframe outline
- Keyboard: R/Shift+R rotate, Delete remove, Escape deselect,
  Ctrl+Z undo, Ctrl+Shift+Z/Ctrl+Y redo
- Listens to DesignState changes to sync scene on undo/redo
- Wired into index.html with DesignState integration
- Added furnitureIndex to mesh userData for state lookups
2026-02-07 12:22:06 +01:00
m
36bc0aedd7 Add DesignState class with observable state and undo/redo
Lightweight state management for furniture editing. All mutations go
through named methods that snapshot state for undo, then notify
listeners. Supports move, rotate, add, remove, full design load,
and serialization via toJSON().
2026-02-07 12:20:03 +01:00
m
35300aa57a Add furniture click events, OrbitControls toggle, and floor change event
- Export COLORS for external module access (themes)
- Extend _onClick to detect furniture clicks before room clicks,
  dispatching 'furnitureclick' with catalog/room/mesh details
- Add setControlsEnabled(enabled) to toggle OrbitControls
- Dispatch 'floorchange' event from showFloor()
- Wire up furnitureclick in index.html to show item info
2026-02-07 12:19:19 +01:00
m
bf4eee8595 Improve 3D renderer: shadow camera, caching, error handling, labels
Renderer improvements:
- Configure shadow camera frustum to cover full house (was default -5..5)
- Add geometry and material caching to reduce GPU allocations
- Add proper disposal of Three.js objects on floor switch (fix memory leak)
- Add error handling for fetch failures with custom event dispatch
- Add room labels as sprites floating in each room
- Support wall-mounted furniture Y positioning via position.y
- Use cached highlight materials instead of mutating shared materials
2026-02-07 12:02:04 +01:00
m
4d76d9525f Add furniture placement to 3D renderer
- loadCatalog() and loadDesign() methods on HouseRenderer
- Builds Three.js meshes from catalog part definitions (box/cylinder)
- Places furniture in room-local coordinates with rotation
- Furniture clears and re-renders on floor switch
- index.html loads catalog and design after house data
2026-02-07 11:42:58 +01:00
m
0d3a4dddf5 Add Three.js 3D room renderer with interactive viewer
renderer.js: HouseRenderer class that loads house JSON and renders
rooms as 3D geometry - walls with door/window cutouts, floors with
material colors, translucent ceilings, orbit camera controls, room
click selection and highlighting.

index.html: Viewer page with sidebar showing floor switcher and
room list with areas. Click rooms in 3D or sidebar to focus camera.
Uses Three.js via CDN importmap (no build step needed).
2026-02-07 11:32:08 +01:00