EarthquakeSim is a web-based 3D earthquake emergency training simulator for office environments. It focuses on take-cover behavior, aftershock awareness, and object stability under seismic motion.
This project is built with Three.js and Vite. It simulates shaking intensity, object topple risk, and a simple scoring/reporting flow to reinforce safe decisions during an earthquake.
- Camera shake with adjustable intensity and aftershocks
- Object shake, topple, and damage cues
- Take-cover interaction with scoring feedback
- CSV training report export
- FPS navigation with pointer lock controls
- Node.js 18+ (recommended)
- npm 9+
npm install
npm run dev -- --port 5175Open: http://localhost:5175
npm run build
npm run preview -- --host --port 5175The build output is generated under dist/.
docker compose up --buildOpen: http://localhost:8080
- Port and host settings are defined in
vite.config.js. - Earthquake intensity, cover logic, and object physics live in
main.js. - UI copy and instruction content live in
index.html.
See MODELS-GUIDE.md for sourcing and integrating 3D models.
index.html: UI layout and scenario copymain.js: core simulation logicstyles/style.css: UI stylingpublic/assets/3D: 3D models used by the scenepublic/assets/hdri: environment lighting
- Keep model files optimized and low-poly for stable FPS
- Use consistent units (meters) for all object positioning
- Test quake intensity changes with multiple runs to avoid extreme camera roll
- Verify cover logic near the desk and exit flow after aftershocks
This simulator is for training and awareness only. It is not a substitute for certified safety training or official emergency procedures.
This project is licensed under the MIT License. See LICENSE for details.