Computer Graphics 2024/25 – Politecnico di Milano
- Overview
- Key Features
- How to Install
- Getting Started
- Technologies Behind the Game
- Code Architecture
- Visual Preview
- License & Usage Terms
Drone Simulator is a 3D interactive game developed using Vulkan and C++ in CLion, designed as part of the Computer Graphics course.
The objective is to control a drone and pass through 10 golden rings within a time limit. This experience emphasizes spatial awareness, control precision, and timing.
- Drone Control via keyboard (
WASD
,QE
,RF
, arrow keys) - Four terrain mountains serve as the simulation environment
- 10 golden rings to collect, disappearing when passed through
- Start station and animated drone model
- On-screen HUD with:
- Timer
- Collected ring counter
- Victory/defeat screen
- Skybox with dynamic lighting
- Multiple difficulty levels and responsive controls
- Vulkan SDK (latest version - shaders use
#version 450
) - CMake ≥ 3.10
- Git
- C++17 compatible compiler (GCC, Clang, MSVC)
- Compatible OS: Windows, Linux, macOS
git clone https://github.com/fparismusic/ComputerGraphics-Project.git
cd DroneSimulator
mkdir build
cd build
cmake ..
make
./DroneSimulator
All required assets (models, textures, shaders) are included in the repository. External libraries and course-provided files (Starter.hpp, Scene.hpp, TextMaker.hpp) are already integrated.
Some models used in this project are large in size (>100 MB) and are tracked using Git LFS (Large File Storage).
If you don’t install Git LFS before cloning, some model files in assets/models/
will appear as text pointer files and your build will fail or show missing objects.
Before cloning:
git lfs install
git clone https://github.com/fparismusic/ComputerGraphics-Project.git
cd DroneSimulator
If you already cloned without LFS:
git lfs pull
If you don’t want to use Git LFS, you can manually download the large model files and copy them to the correct folder:
- Download from: This link
- Then copy the files to:
assets/models/
W
/A
/S
/D
→ Move forward/backward/left/rightQ
/E
→ Rotate left/rightR
/F
→ Ascend/descend- Arrow Keys → Adjust orientation
Fly through 10 golden rings as fast as possible.
All rings collected before time runs out.
Time expires before collecting all rings.
- Vulkan – real-time graphics API
- Phong shading model
- Physically Based Rendering (PBR)
- Skybox with environment mapping
- HUD via TextMaker and images
- JSON-based scene loading
- Shader-driven ring disappearance logic
- Multiple difficulty levels
- Real-time ring counter and timer
- Course-provided headers:
Starter.hpp
,Scene.hpp
,TextMaker.hpp
- The main game class
DroneSimulator
inherits fromBaseProject
- Scene is defined in external
.json
files
Method | Purpose |
---|---|
setWindowParameters() |
Define window size, title, and vsync settings |
onWindowResize(int w, int h) |
Handle viewport and framebuffer adjustments on window resize |
localInit() |
Load Vulkan models and textures, initialize Descriptor Set Layouts, load shaders |
pipelinesAndDescriptorSetsInit() |
Create Vulkan pipelines and descriptor sets |
pipelinesAndDescriptorSetsCleanup() |
Destroy pipelines and descriptor sets (temporary) |
localCleanup() |
Fully destroy models, textures, layouts and pipelines |
populateCommandBuffer() |
Record all drawing commands to be submitted to the GPU |
updateUniformBuffer() |
Update camera, lighting and game-related uniforms each frame |
Method | Description |
---|---|
setCameraMode(GLFWwindow*) |
Switch between different camera modes |
getDroneInput(GLFWwindow*, float deltaT) |
Handle real-time drone controls via keyboard |
updateGlobalUBO(GlobalUniformBufferObject&, float elapsedTime) |
Change lighting color dynamically over time |
reset() |
Reset the game state after win/lose |
loadMountainPoints(std::vector<glm::vec3>&) |
Extract mountain geometry to detect collisions |
isTooCloseToMountain(...) |
Prevent drone from clipping into terrain |
checkRingPassage(...) |
Detect if the drone successfully passed through a ring |
- Assets and textures are included in the
assets/models
andassets/textures
folder, sourced from Sketchfab - Rendering pipelines:
- Phong shading for environment (e.g., terrain)
- PBR rendering for the drone model
- Skybox
- Live updates on:
- Elapsed time
- Collected rings
- Win/lose state
Figure 3: Flying drone with ring.
DRONE-SIMULATOR © 2025 All Rights Reserved. No part of this project may be reproduced, copied, or used for commercial or academic purposes without explicit permission from the authors.
This game was developed as an academic project for educational purposes only.