deaneeth/furnish-view-hci-project
A Java Swing furniture room visualizer with 2D layout and 3D rendering for in-store design consultations - PUSL3122 Coursework 2025-26
FurnishView
Interactive 2D/3D Room Design & Furniture Visualisation Tool
Empowering furniture designers to create, visualise, and present room layouts โ from a quick 2D top-down canvas to an immersive, orbit-able 3D scene.
๐ Live Demo ย ยทย ๐ฌ Video Walkthrough ย ยทย โก Quick Start ย ยทย ๐๏ธ Architecture
๐ Table of Contents (click to expand)
๐ช Overview
FurnishView is a web-based room design tool built for in-store furniture consultations. A designer logs in, inputs a customer's room specifications, places furniture on a 2D top-down canvas, then generates a full 3D walkthrough-ready scene โ all in the browser, with no installation required.
Built as coursework for PUSL3122 โ HCI & Computer Graphics (2025โ26), the project demonstrates layered MVC architecture, hand-coded 2D canvas algorithms, Three.js 3D rendering with proper lighting and shading, and a full user-centred design process backed by formative and summative usability studies.
| Attribute | Detail |
|---|---|
| Module | PUSL3122 โ HCI & Computer Graphics |
| University | Plymouth University Sri Lanka (PUSL) |
| Year | 2025โ26 |
| Tech | JavaScript (ES6+) ยท HTML5 Canvas ยท Three.js r160 ยท CSS3 |
| Run | Open index.html in Chrome/Firefox โ no npm, no server, no setup |
โจ Key Features
|
๐ Room Design
๐ฑ๏ธ 2D Canvas Engine
๐ 3D Visualisation
|
๐ Design Comparison (Innovation)
๐ค Auto-Arrange (Innovation)
๐ E-commerce Pipeline (Innovation)
๐ Role-Based Auth
๐พ Data Handling
|
๐ธ Screenshots & Demos
๐๏ธ Architecture
FurnishView enforces strict ModelโViewโController separation. Each layer has a defined responsibility โ crossing boundaries is a code smell and is actively avoided.
flowchart TD
subgraph Models["๐ฆ Models (js/models/)"]
R[Room.js]
F[FurnitureItem.js]
D[Design.js]
end
subgraph Views["๐ผ๏ธ Views (js/views/)"]
LV[LoginView.js]
DV[DashboardView.js]
EV[EditorView.js]
subgraph Components["components/"]
TB[Toolbar.js]
SB[Sidebar.js]
M[Modal.js]
T[Toast.js]
end
end
subgraph Controllers["๐ฎ Controllers (js/controllers/)"]
DC[DesignController.js]
CC[CanvasController.js]
end
subgraph Graphics["๐จ Graphics (js/graphics/)"]
R2D[Renderer2D.js]
R3D[Renderer3D.js]
CM[ColourManager.js]
end
subgraph Utils["๐ ๏ธ Utils (js/utils/)"]
ST[storage.js]
SC[scaleCalculator.js]
CN[constants.js]
end
app.js -->|initialises| Views
Views -->|calls| Controllers
Controllers -->|mutates| Models
Controllers -->|triggers| Graphics
Graphics -->|reads| Models
Graphics -->|uses| Utils
Controllers -->|uses| Utils
Models -->|serialised by| STSeparation of Concerns
| Layer | Responsibility | What it never does |
|---|---|---|
| Models | Pure data โ room/furniture/design state | No DOM, no rendering, no events |
| Views | Generate HTML, render to DOM, bind events | Never access models directly for logic |
| Controllers | Orchestrate views โ models, handle business logic | No direct DOM manipulation, no raw canvas calls |
| Graphics | All canvas and Three.js rendering | Knows nothing about the DOM outside its canvas |
Key Design Decisions
- Zero build step โ no Webpack, Vite, or npm. Open
index.htmland it works. Assessed work must run offline. - Three.js r160 bundled locally in
lib/โ CDN failure cannot break submissions. MeshStandardMaterialenforced โ noMeshBasicMaterialanywhere. All geometry responds to lighting for visible shading.preserveDrawingBuffer: trueon the WebGL renderer โ enables PNG export without a blank canvas bug.
๐ ๏ธ Tech Stack
โก Quick Start
Prerequisites
- A modern browser: Chrome 90+ or Firefox 88+ (WebGL and ES modules required)
- For ES module support without a server: use VS Code Live Server extension
Option 1 โ Direct File Open (Simplest)
# Clone the repository
git clone https://github.com/deaneeth/furnish-view-hci-project.git
cd furnish-view-hci-project
# Open in your browser
# On Windows:
start index.html
# On macOS:
open index.html
# On Linux:
xdg-open index.html
โ ๏ธ Some browsers block ES module imports fromfile://URLs. If the app shows a blank screen, use Option 2.
Option 2 โ VS Code Live Server (Recommended)
- Open the project folder in VS Code
- Install the Live Server extension if not already installed
- Right-click
index.htmlโ Open with Live Server - App opens at
http://127.0.0.1:5500
Option 3 โ Simple HTTP Server
# Python 3
python -m http.server 8080
# Then visit http://localhost:8080
# Node.js (npx, no install needed)
npx serve .
# Then visit http://localhost:3000Test Credentials
| Role | Username | Password |
|---|---|---|
| Designer | designer1 |
password123 |
| Designer | designer2 |
password123 |
| Admin | admin |
admin123 |
๐ Authentication
FurnishView uses a client-side, role-based authentication system backed entirely by localStorage.
furnishview_users โ Array of registered designer credentials
furnishview_session โ Currently active session (cleared on logout)
furnishview_designs โ All saved Design objects (filtered per designer on load)
| Role | Access |
|---|---|
| Designer | Create, view, edit, and delete their own designs only |
| Admin | View and manage all designs across all designers; system-level controls |
Session persists across browser refreshes until the user explicitly logs out. No cookies, no tokens, no network calls.
๐ฌ Feature Deep-Dive
๐ฑ๏ธ 2D Canvas Engine (Renderer2D.js)
The 2D canvas is a hand-coded computer graphics engine built on the raw HTML5 Canvas API. No canvas frameworks are used โ every algorithm is implemented from scratch.
Coordinate Scaling
scaleFactor = canvasWidth / roomWidthInMeters
pixelX = realWorldX ร scaleFactor
pixelY = realWorldY ร scaleFactor
All furniture positions are stored in real-world meters. On every render pass, they are scaled to canvas pixels using this factor.
Hit Detection
A classic point-in-axis-aligned-rectangle (AABB) test for click/select:
isHit = (clickX >= item.x) && (clickX <= item.x + item.width)
&& (clickY >= item.y) && (clickY <= item.y + item.depth)
Items are tested in reverse render order so the topmost rendered item gets selection priority.
Boundary Clamping
Furniture cannot be dragged outside the room boundary:
item.x = clamp(item.x, 0, room.width - item.width)
item.y = clamp(item.y, 0, room.depth - item.depth)
Drag Offset
On mousedown, the offset between the cursor and the item's top-left corner is captured:
offset.x = mouseX - item.x
offset.y = mouseY - item.y
During mousemove, position is updated as item.x = mouseX - offset.x โ the item follows the cursor without jumping.
Render Loop
clearRect() โ draw room outline โ draw grid (optional) โ draw all furniture โ highlight selected item. Runs on every mouse event during drag via requestAnimationFrame.
๐ 3D Visualisation Engine (Renderer3D.js)
Built with Three.js r160. The scene is constructed entirely from primitives โ no external 3D model files.
Scene Setup
// Core pipeline
Scene โ PerspectiveCamera โ WebGLRenderer (preserveDrawingBuffer: true) โ OrbitControls
// Lighting (critical for shading marks)
AmbientLight(0xffffff, 0.6) // Base illumination
DirectionalLight(0xffffff, 0.8) // Creates shadows + visible shadingRoom Geometry
- Floor โ
PlaneGeometry, rotated โ90ยฐ on X axis, positioned at Y = 0 - Walls โ Four thin
BoxGeometrymeshes positioned at room edges
Furniture Geometry
- Each item โ
BoxGeometry(width, height, depth)withMeshStandardMaterial - Positioned by mapping 2D canvas coordinates โ 3D world space:
3D.x = (2D.x / scaleFactor) - (roomWidth / 2) 3D.z = (2D.y / scaleFactor) - (roomDepth / 2) 3D.y = furnitureHeight / 2 // sits on the floor
Colour Synchronisation
ColourManager.js maps hex colour strings from the model to Three.js Color objects, keeping 2D and 3D appearances identical.
Export
const dataURL = renderer.domElement.toDataURL('image/png')
// Works because preserveDrawingBuffer: true was set on construction๐ค Auto-Arrange Algorithm (Innovation)
The auto-arrange feature distributes furniture items within the room using a rule-based spatial algorithm:
- Calculate the room's usable area (accounting for wall clearance โ typically 0.5m from each wall)
- Group furniture by type (seating, tables, storage)
- Place tables first at functional positions (dining table centred, bedside tables flanking bed)
- Distribute seating around tables using angular offsets
- Fill remaining space with storage units along walls
- Run boundary clamp on all positions to guarantee no overlaps with walls
The algorithm respects standard interior design clearance rules (e.g., 0.9m aisle width around dining tables) derived from BS 8300 accessibility guidelines.
๐ Design Comparison Mode (Innovation)
Renders two saved designs simultaneously in a split-screen layout:
- Two independent Three.js
WebGLRendererinstances, each targeting a separate<canvas>element - Both share the same lighting parameters for fair visual comparison
OrbitControlsattached to each canvas independently โ rotating one view does not affect the other- The designer selects two designs from the dashboard; the comparison view loads them in parallel
This reuses 100% of the existing Renderer3D class โ the comparison view is essentially two editor panels with their sidebars hidden.
๐ E-commerce Pipeline (Innovation)
After finalising a design, the designer can generate a customer take-home document:
- PNG Export โ
canvas.toDataURL('image/png')for the 2D view;renderer.domElement.toDataURL()for 3D - PDF Export โ Uses
jsPDF(loaded fromlib/) to compose a document containing:- Design name and date
- 2D layout screenshot
- 3D render screenshot
- Bill of materials โ furniture items with type, colour, and catalogue dimensions
The generated PDF is downloaded directly in the browser โ no server upload required.
๐ Room Preset Templates (Innovation)
Defined in js/data/roomPresets.js, each preset auto-populates the room setup form:
| Preset | Width | Depth | Height | Default Wall | Default Floor |
|---|---|---|---|---|---|
| Studio Apartment | 6m | 5m | 2.8m | #F5F0EB |
#C8B89A |
| Living Room | 5m | 4m | 2.8m | #E8E0D4 |
#8B7355 |
| Dining Room | 4.5m | 3.5m | 2.6m | #EDE8E0 |
#6B5344 |
| Bedroom | 4m | 3.5m | 2.7m | #F0EBE5 |
#A0896C |
Selecting a preset fires a single event that populates all six form fields instantly, supporting Heuristic #7 โ Flexibility and Efficiency of Use (Nielsen, 1994).
๐ Project Structure
furnish-view-hci-project/
โโโ index.html # Entry point โ loads js/app.js as ES module
โ
โโโ css/
โ โโโ main.css # Global styles, CSS custom properties, layout
โ โโโ components.css # Toolbar, Sidebar, Modal, Toast styles
โ โโโ canvas.css # 2D/3D canvas container sizing
โ
โโโ js/
โ โโโ app.js # Initialisation, view routing (login โ dashboard โ editor)
โ โ
โ โโโ auth/
โ โ โโโ auth.js # Login validation, session management
โ โ
โ โโโ models/ # โโ Pure data objects, zero DOM/rendering โโ
โ โ โโโ Room.js # Dimensions, shape, wall/floor colour
โ โ โโโ FurnitureItem.js # Type, position, dimensions, colour, rotation
โ โ โโโ Design.js # One Room + FurnitureItem[] + metadata
โ โ
โ โโโ views/ # โโ DOM rendering, HTML generation โโ
โ โ โโโ LoginView.js
โ โ โโโ DashboardView.js
โ โ โโโ EditorView.js
โ โ โโโ components/
โ โ โโโ Toolbar.js # Furniture catalogue + action buttons
โ โ โโโ Sidebar.js # Room & furniture property panels
โ โ โโโ Modal.js # Reusable confirmation / wizard modals
โ โ โโโ Toast.js # Non-blocking action notifications
โ โ
โ โโโ controllers/ # โโ Event handling, logic orchestration โโ
โ โ โโโ DesignController.js # CRUD design workflow
โ โ โโโ CanvasController.js # Mouse/touch events on 2D canvas
โ โ
โ โโโ graphics/ # โโ All rendering logic โโ
โ โ โโโ Renderer2D.js # HTML5 Canvas 2D engine (hand-coded algorithms)
โ โ โโโ Renderer3D.js # Three.js scene manager
โ โ โโโ ColourManager.js # Colour sync across 2D + 3D views
โ โ
โ โโโ utils/
โ โ โโโ storage.js # localStorage CRUD wrapper
โ โ โโโ scaleCalculator.js # Real-world โ pixel/unit conversions
โ โ โโโ constants.js # App-wide constants, default values
โ โ
โ โโโ data/
โ โโโ furnitureCatalogue.js # Furniture type definitions + default dimensions
โ โโโ roomPresets.js # Pre-built room templates (innovation feature)
โ
โโโ lib/ # Three.js r160 โ committed, works offline
โ โโโ three.module.js
โ โโโ three.min.js
โ โโโ OrbitControls.js
โ
โโโ assets/
โ โโโ screenshots/ # App screenshots for README and report
โ โโโ textures/ # Optional floor/wall texture maps
โ โโโ sample-data/ # Pre-loaded designs for demo (video)
โ
โโโ formative-docs/ # Formative usability study documentation
โ โโโ P1.md / P2.md # Raw observer session notes
โ โโโ participant-P1.md # Structured observation sheet โ P1
โ โโโ participant-P2.md # Structured observation sheet โ P2
โ โโโ observer-sheet.md # Study summary and findings
โ โโโ observation-sheet-RESEARCHER-USE.md # Filled researcher log
โ
โโโ requirements/
โโโ PROJECT OVERVIEW.md # Full project blueprint and architecture spec
โโโ End-to-End-Project-Roadmap.md # Phase-by-phase implementation roadmap
โโโ REPO_WORKFLOW.md # Branch, commit, and PR conventions
๐งช Testing & Evaluation
FurnishView underwent a two-phase HCI evaluation following the think-aloud protocol and System Usability Scale (SUS) methodology.
Formative Study (Pre-Implementation)
| Attribute | Detail |
|---|---|
| When | After lo-fi prototypes, before hi-fi design |
| Method | Think-Aloud Protocol |
| Participants | P1, P2 (anonymised adults, target user profile) |
| Tasks | 5 realistic in-store consultation tasks |
| Artefacts | Test plan ยท Consent forms ยท Observation sheets ยท Session notes |
Key findings that shaped the hi-fi design:
- The "3D View" toggle was labelled "Visualise" in the lo-fi prototype โ participants did not associate it with 3D. โ Renamed to "3D View" in hi-fi.
- The undo button was missing from the lo-fi toolbar โ P1 accidentally deleted furniture and could not recover. โ Undo added as a persistent toolbar action.
- Toolbar icons were considered too small on a tablet-sized display. โ Icons enlarged to 32 ร 32px minimum in hi-fi.
- P2 expected clicking a furniture item to open its properties automatically. โ Sidebar refreshes on item selection in implementation.
Summative Study (Post-Implementation)
| Attribute | Detail |
|---|---|
| When | After working app was complete |
| Method | Think-Aloud Protocol + SUS Questionnaire |
| Participants | P3, P4 (anonymised adults) |
| SUS Score | 78.75 / 100 โ "Good" usability band (Bangor et al., 2009) |
| Task Completion | 100% across all 5 tasks for both participants |
Key SUS interpretation: Score 78.75 places FurnishView in the "Good" tier (above the industry average of 68), indicating the interface is learnable, efficient, and satisfying for the target user demographic.
Areas for further improvement identified:
- 3D scene takes slightly longer to load for rooms with many items (optimisation opportunity)
- Rotation handle for furniture on the 2D canvas was not immediately discoverable (discoverability improvement needed)
๐ฏ HCI Framework Alignment
Nielsen's 10 Usability Heuristics (Nielsen, 1994)
| # | Heuristic | FurnishView Implementation |
|---|---|---|
| 1 | Visibility of System Status | Toast notifications on every action; selected furniture highlighted; loading indicator during 3D build |
| 2 | Match System and Real World | Dimensions in metres; furniture named "Dining Table" not "Item_003"; spatial layout mirrors a physical room |
| 3 | User Control and Freedom | Undo button for placement/removal; cancel on all dialogs; back navigation from editor to dashboard |
| 4 | Consistency and Standards | Single colour picker component reused everywhere; Ctrl+S saves in all views; consistent button hierarchy |
| 5 | Error Prevention | Confirmation modal before delete; room dimension validation (no negative/zero values); boundary clamping |
| 6 | Recognition Rather Than Recall | Furniture shown as visual thumbnails; saved designs as named cards; recent colours visible in picker |
| 7 | Flexibility and Efficiency of Use | Drag-and-drop; Del key removes selection; room presets reduce setup from 6 fields to 1 click |
| 8 | Aesthetic and Minimalist Design | Clean layout โ only relevant controls visible per mode; whitespace used intentionally |
| 9 | Help Users Recover from Errors | Descriptive validation messages; undo for accidental changes; non-destructive colour edits |
| 10 | Help and Documentation | Tooltips on all toolbar buttons; placeholder text in all form fields |
Norman's Design Principles (Norman, 1988)
| Principle | FurnishView Application |
|---|---|
| Visibility | Toolbar always visible; active tool highlighted; selected item shows handles |
| Feedback | Toast on every action; canvas redraws instantly on drag; 3D updates on colour change |
| Constraints | Boundary clamping; form validation; radio buttons for room shape (not free text) |
| Consistency | Same colour picker for walls, floor, and furniture; Ctrl+S always saves |
| Affordance | Furniture thumbnails invite dragging (cursor changes on hover); colour swatches look selectable |
๐ค Contributing
This is academic coursework โ external PRs are not expected, but team contributions are tracked via Git.
For team members:
- Branch from
devโ never commit directly tomaingit checkout dev git pull origin dev git checkout -b feature/your-feature-name
- Follow the commit convention from
requirements/REPO_WORKFLOW.md:feat(canvas): implement drag-and-drop furniture placement fix(3d): resolve shadow rendering on wall geometry docs(eval): add summative study observation notes - Open a PR to
devwith a description that references the relevant task from the roadmap - Get at least one review before merging
- Never merge broken code โ verify
index.htmlopens without console errors first
๐ฅ Team
Dineth Hettiarachchi Lead Developer Architecture ยท 2D Engine ยท 3D Scene ยท Innovation Features |
Lakindu Pahesara Design Lead Personas ยท Storyboards ยท Lo-Fi / Hi-Fi Prototypes ยท Report |
Thanuji Kalanika Evaluation Lead Test Plans ยท User Studies ยท SUS Scoring ยท Consent Forms |
๐ License & Credits
License
This project is submitted as academic coursework for PUSL3122 at Plymouth University Sri Lanka. All original source code is available under the MIT License for reference purposes.
MIT License โ Copyright (c) 2026 Dineth Hettiarachchi and contributors
Third-Party Credits
| Library | Version | License | Source |
|---|---|---|---|
| Three.js | r160 | MIT | threejs.org |
| OrbitControls.js | r160 | MIT | three/examples |
| jsPDF | 2.x | MIT | parallax/jsPDF |
Key References
- Nielsen, J. (1994). 10 Usability Heuristics for User Interface Design. NN/g.
- Norman, D. (1988). The Design of Everyday Things. Basic Books.
- Preece, J., Sharp, H. & Rogers, Y. (2019). Interaction Design. 5th ed. Wiley.
- Brooke, J. (1996). SUS: A Quick and Dirty Usability Scale.
- Dirksen, J. (2018). Learn Three.js. 3rd ed. Packt.
- Angel, E. & Shreiner, D. (2014). Interactive Computer Graphics. 7th ed. Pearson.
- MDN Web Docs โ Canvas API
- Three.js Documentation โ threejs.org/docs






