An academic Computer Graphics & Visualisation (CGV) project built with
C++17 · OpenGL (3.3 core context) · GLFW · GLM · Dear ImGui.
# 1. Clone / extract the project, then from the project root:
chmod +x setup.sh
./setup.sh # installs apt packages, downloads GLAD + ImGui, builds
# 2. Run
./build/InteriorPlannerEvaluation system note:
setup.shinstallslibglfw3-dev,libglm-dev,
andlibgl1-mesa-devvia apt, then builds the project. If vendored files in
include/are missing, it bootstraps GLAD and Dear ImGui sources once.
Re-runcmake .. && makefrom thebuild/directory for rebuilds.
The app opens in this mode.
Use the ImGui panel (top-left) to:
| Control | Description |
|---|---|
Room Width (X) slider |
Room width in world units (1 unit ≈ 1 metre) |
Room Depth (Z) slider |
Room depth in world units |
Name text field |
Furniture type label (e.g. "Sofa") |
Width / Depth / Height sliders |
Furniture bounding-box dimensions |
Color picker |
Display colour for the item |
| + Add Furniture Type button | Registers the type for placement |
| Proceed to 2D Builder button | Advances to Stage 2 (requires ≥1 type) |
Place furniture on the floor plan.
| Input | Action |
|---|---|
| Left-click viewport | Place the selected furniture item at cursor position |
| Right-click viewport | Undo the last placed item |
| Z key | Also undoes the last placed item |
| Scroll wheel | Zoom the 2D view in / out |
| ImGui buttons | Switch selected furniture type, clear all, back, enter 3D |
Collision rules:
- Items cannot overlap each other (AABB test).
- Items cannot extend outside the room walls.
- A green preview box appears when placement is valid; red when blocked.
| Input | Action |
|---|---|
| Left-click viewport | Capture mouse for FPS look-around |
| Mouse move | Look around (yaw + pitch) |
| W / S | Move forward / backward |
| A / D | Strafe left / right |
| Esc (first press) | Release mouse cursor |
| Esc (second press) | Return to Stage 2 |
Move Speed slider |
Adjust movement speed |
FOV slider |
Adjust field of view |
Lighting: ambient + directional Blinn-Phong.
Camera height is fixed at 1.6 m (eye level).
project_root/
├── CMakeLists.txt # Build configuration
├── setup.sh # One-shot setup + build script
├── README.md
├── src/
│ ├── main.cpp # GLFW init, state machine, input callbacks, ImGui panels
│ ├── Scene.h / .cpp # Room data, FurnitureDef, PlacedFurniture, AABB logic
│ ├── Camera.h / .cpp # Orthographic & perspective matrices, FPS movement
│ ├── Renderer.h / .cpp # VAOs, VBOs, shader loading, draw2D / draw3D
├── shaders/
│ ├── flat.vert / flat.frag # Unlit colour shader (Stage 2)
│ └── phong.vert / phong.frag # Blinn-Phong shader (Stage 3)
└── include/ # Populated by setup.sh
├── glad/ # GLAD OpenGL loader
├── KHR/ # Khronos platform header
└── imgui/ # Dear ImGui sources + GLFW/OpenGL3 backends
# Prerequisites (Ubuntu/Debian)
sudo apt-get install build-essential cmake libglfw3-dev libglm-dev libgl1-mesa-dev
# Manually place GLAD and ImGui headers in include/ (see setup.sh for URLs)
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
cd ..
./build/InteriorPlanner- Projection switch:
glm::orthoin Stage 2 →glm::perspectivein Stage 3. - Mouse picking (Stage 2): NDC coordinates are un-projected to world XZ by
reversing the orthographic transform (no ray-casting needed for top-down). - AABB collision: Separating-axis theorem in 2D (XZ plane) prevents overlap
and out-of-bounds placement. - Phong shading:
transpose(inverse(model))normal matrix ensures correct
normals under non-uniform scaling. - MSAA: Window hint
GLFW_SAMPLES 4enables 4× multi-sample anti-aliasing.
| Library | Version | Licence |
|---|---|---|
| GLFW | 3.x (system) | zlib |
| GLM | system | MIT |
| GLAD | vendored generator output | MIT / Apache 2.0 |
| Dear ImGui | 1.90.4 | MIT |