A 3D interactive walkthrough of your college campus using Three.js.
- Place your
.glbfile in this folder - Open
main.jsand update line 150 with your filename:loader.load('your-campus-model.glb', // <-- Change this
Using Python:
# Python 3
python -m http.server 8000
# Then open: http://localhost:8000Using Node.js:
# Install http-server globally
npm install -g http-server
# Run server
http-server
# Then open: http://localhost:8080Using VS Code:
- Install "Live Server" extension
- Right-click on
index.htmland select "Open with Live Server"
- Open Chrome/Edge with disabled security (only for development)
- Close all browser instances
- Run with CORS disabled:
# Windows chrome.exe --disable-web-security --user-data-dir="C:/temp/chrome-dev"
- Click anywhere to start
- W/↑ - Move forward
- S/↓ - Move backward
- A/← - Strafe left
- D/→ - Strafe right
- Mouse - Look around
- ESC - Exit pointer lock mode
- ✅ First-person camera controls
- ✅ GLB model loading
- ✅ Realistic lighting (ambient, directional, hemisphere)
- ✅ Fog effect for atmosphere
- ✅ Shadow rendering
- ✅ Keyboard + mouse controls
- ✅ Stickman character (can be made visible for third-person view)
In main.js, line 103:
const moveSpeed = 5.0; // Increase or decreaseIn main.js, line 31 and 233:
camera.position.set(0, 1.7, 5); // 1.7 meters is average eye heightIn main.js, line 206, change:
stickmanGroup.visible = true; // Show stickmanThen adjust camera position to be behind the character.
Adjust light intensities in main.js (lines 47-67) for different times of day.
- Check browser console (F12) for errors
- Ensure GLB filename matches exactly (case-sensitive)
- Verify file is in the same folder as index.html
- Must use a local server (CORS policy)
- Click on the screen first to activate pointer lock
- Check browser console for JavaScript errors
- Optimize your GLB model (reduce polygon count)
- Reduce shadow map size in
main.js(line 60) - Lower renderer pixel ratio (line 40)
- Add collision detection with the campus buildings
- Implement jump functionality
- Add minimap
- Include interactive points of interest
- Add day/night cycle
- Include ambient sounds
Enjoy your campus tour! 🎓