A 3D scene with procedurally generated spheres, real-time camera controls, and custom vertex/fragment shaders using OpenGL 3.3.
This project renders a 3D scene featuring multiple color-coded spheres with smooth shading, built entirely with modern OpenGL (core profile). The scene includes a free-look camera with mouse and keyboard controls, perspective projection, and per-vertex coloring through custom GLSL shaders.
- Procedural sphere generation using parametric UV sphere tessellation
- Multiple objects with distinct colors and scales
- Free-look camera with WASD movement, mouse look, and scroll zoom
- Custom GLSL shaders — vertex shader for transformations, fragment shader for coloring
- Real-time rendering with delta-time-based movement
| Input | Action |
|---|---|
| W / A / S / D | Move camera forward / left / back / right |
| Mouse | Look around |
| Scroll | Zoom in/out |
| ESC | Close window |
- C++ (OpenGL 3.3 Core Profile)
- GLFW — window management and input
- GLAD — OpenGL function loader
- GLM — mathematics (vectors, matrices, transformations)
- GLSL — vertex and fragment shaders
Requires CMake and OpenGL development libraries:
cd OpenGL
mkdir build && cd build
cmake ..
make
./OpenGLOpenGL/
├── OpenGL/
│ ├── Main.cpp # Application entry point and rendering loop
│ ├── vshader.vs # Vertex shader (MVP transformations)
│ └── fshader.fs # Fragment shader (color output)
└── Libraries/ # GLAD, GLFW, GLM headers
| Name | Student Number |
|---|---|
| Mehrshad Mirmohammadi | 98109634 |
| Ghazal Shenavar | 97101897 |
Computer Graphics Mini-Course, Summer 2021