Graphics project made with C++/OpenGL/glut/glew
-
Extra features
- Add object collisions for barrier arms
- Change dance floor to react to user's music
-
Refactor
- Break into logic and view sections
- Split into multiple files with headers
-
Fix bugs:
- Investigate existing mouse bug where looking up too high creates mouse issues
- Barrier arm lights don't glow. Only reflect from center light
- Poor performance on OSX. Runs at a high FPS on Linux however
This project has been partially modernized into an OOP/module architecture to make future changes safer and faster.
- include/world_state.h
- include/input_controller.h / src/input_controller.cpp
- include/animation_system.h / src/animation_system.cpp
- include/renderer.h / src/renderer.cpp
- docs/ARCHITECTURE.md
- State was centralized into WorldState so mutable runtime data is no longer spread across unrelated logic.
- Input behavior moved into InputController so key/mouse policy is isolated from rendering.
- Time-based movement moved into AnimationSystem so timer callbacks only trigger deterministic state updates.
- Camera transform setup moved into Renderer to decouple presentation from gameplay logic.
Both compile scripts now compile multiple source files instead of one monolithic cpp.
See docs/ARCHITECTURE.md for a teaching-oriented walkthrough.
The scene now reacts to four values read from data/visualizer_input.txt:
lowin[0, 1]midin[0, 1]highin[0, 1]- optional
beatin[0, 1]
Format:
0.63 0.41 0.77 1.0Reactive mapping:
- Speaker towers scale with low frequencies and pulse on beats.
- Speaker face rings expand and recolor with mid/high frequencies.
- Dance floor colors now track low/mid/high bands.
- A pulse sphere flashes around the dance floor on stronger beat energy.
If no external file updates are provided, the app uses a procedural fallback signal so the visualizer remains animated.
Run the app in one terminal, and in another terminal run:
chmod +x ./scripts/simulate_visualizer_input.sh
./scripts/simulate_visualizer_input.shThis continuously updates data/visualizer_input.txt with synthetic band values.
This project now includes a Linux output-audio bridge that reads the default sink monitor (not microphone input) and converts it to low/mid/high/beat values.
Files:
Run flow:
- In terminal A:
./compile_on_linux.sh
./gl 2- In terminal B:
chmod +x ./scripts/run_system_audio_visualizer.sh
./scripts/run_system_audio_visualizer.shThat bridge auto-selects your default sink monitor using pactl, so any desktop output
(Spotify desktop/web, YouTube in Firefox, etc.) drives the scene.
Notes:
- Uses PulseAudio/PipeWire tools:
pactl,parec. - The wrapper creates
.venv_audioand installsnumpyautomatically. - Stop bridge with
Ctrl+C.