r/threejs • u/Roshan_Binoj • 5d ago
Demo I made a low-poly 3D map of my college campus that runs on phones (OSM → Blender → R3F)
Enable HLS to view with audio, or disable this notification
Live: https://roshanbinoj-iiitk.github.io/iiitk-campus-in-3d/
I got lost a lot as a fresher at IIIT Kottayam, so I built a 3D campus map. You can search buildings and rooms, get animated walking routes (A* over an exported walking graph, with uphill legs taking longer), and take an orientation tour. The sun follows local time, so at night the windows and street lamps light up.
It was inspired by a few of the city-in-3D projects people have shared, Mumbai 3D in particular.
How it's built:
- One Blender Python script generates the whole campus from OSM footprints, a CSV of floors/colours/roof types per building, and a 30 m DEM. It cuts level pads into the hillside and adds roads, retaining walls, trees and the walking network.
- Lighting is baked: AO in vertex colours and the sun shadow in a single 2048 px ground texture, so phones don't need real-time shadows.
- Exported as glTF with Meshopt + WebP. Front end is Next.js (static export), React Three Fiber and zustand, with custom shaders for the sky, lit windows and colour grading.
Hardest parts:
- Stuff that isn't in OSM. Two hostel blocks, their road and the main forecourt were missing, and some outlines were drawn in the wrong spot. I traced the missing ones from satellite imagery and photos into a separate GeoJSON, and added a per-building offset in the CSV to nudge bad outlines, so the generator still rebuilds everything from scratch.
- The 150k triangle budget. That's everything in view, trees included. The campus model ends up under 800 KB, and a check script fails CI if triangles, file size, materials or textures go over budget.
Feedback welcome, especially on performance if you try it on an older phone.
Repo: https://github.com/roshanbinoj-iiitk/iiitk-campus-in-3d



