COMPLETE2024Graphics Engineer
3D City Simulation
OpenGL city with day/night cycles and live weather
C++OpenGLCode::BlocksGLUT
[ 01 ] — Context
Problem
- Computer graphics coursework needed to demonstrate mastery of the full OpenGL pipeline — geometry, lighting, and interaction — rather than a single static scene.
[ 02 ] — Response
Solution
Simulation City builds an entire block grid with buildings, roads, and vehicles. A day/night cycle interpolates ambient and directional light; weather modes toggle particle rain and snow; and traffic lights cycle red → green with keyboard-controlled camera navigation.
Everything is generated from a single scene graph, so light state, weather state, and traffic state compose cleanly.
[ 03 ] — Structure
Architecture
SceneGraph (city blocks, roads, vehicles) ├── DayCycle → ambient + directional light lerp ├── Weather → rain / snow particle emitters ├── TrafficLights → per-intersection state machine └── Camera → WASD + orbit (GLUT keyboard)
[ 04 ] — Trade-offs
Key engineering decisions
- 01
State-as-machine over per-frame hacks
Traffic lights are a three-state machine (red → green → amber) advanced by a timer, so timing stays consistent regardless of frame rate.
[ 05 ] — Under the hood
Engineering highlights
Weather without geometry explosion
struct Particle { vec3 pos; vec3 vel; float life; };
for (auto &p : particles) {
p.vel.y = mode == RAIN ? -9.8f : -1.2f; // gravity per mode
p.life -= dt;
if (p.life <= 0) respawn(p); // recycle, no alloc
}[ 06 ] — Outcomes
Results
6
rendered modes (day, night, rain, snow, traffic)
1
scene graph for all state
WASD
free camera controls
[ 07 ] — Visuals
Screenshots
[ 08 ] — Where it's going
Status & next steps
- Add textured buildings and reflections for a stronger visual pass.
