scop.mp4
Scop is a project from the 42 Post-Common Core curriculum, designed to introduce students to low-level graphics programming using APIs like Vulkan, Metal or OpenGL.
The objective is to create a simple 3D OBJ renderer that displays textures and can rotate along all three axes.
| Key | Action |
|---|---|
W |
Move camera forward |
S |
Move camera backward |
A |
Move camera left |
D |
Move camera right |
← |
Rotate camera left |
→ |
Rotate camera right |
| Key | Action |
|---|---|
X |
Set rotation axis to X |
Y |
Set rotation axis to Y |
Z |
Set rotation axis to Z |
Space |
Stop model rotation |
| Key | Action |
|---|---|
F1 |
Point mode |
F2 |
Wireframe mode |
F3 |
Fill mode |
| Key | Action |
|---|---|
F4 |
Apply texture |
F5 |
Apply dissolve effect |
F6 |
Play Bad Apple |
| Key | Action |
|---|---|
| P | Play / Pause audio |
| Key | Action |
|---|---|
| ESC | Exit application |
- C++
- CMake
- GLSL
- OpenGL
- SDL3
The main challenge was understanding how the GPU renders pixels, and why triangles are important. Then I had to learn what OpenGL is and how to use it. Of course, I had to learn some basic mathematics, such as matrices, since matrix operations are not commutative. And lastly, how to use CMake.
I'm planning to add Metal and Vulkan backends later.
clang --version
gcc --version- Ensure you have installed CMake to build the project
cmake --version- Create a build folder to organize the build files:
mkdir build- Generate build files with CMake:
cmake -S . -B build- Build the project using CMake:
cmake --build build --config ReleaseNote
On macOS, OpenGL is deprecated, so you might encounter warnings during the build process. However, these warnings do not cause any issues and can be safely ignored.
- To run the program, provide the path to an OBJ model and its corresponding TGA texture file as arguments:
./build/Release/scop [./assets/models/.obj] [./assets/textures/.tga]-
FirePh0enix: Thanks for your help in choosing an API and advising that OpenGL would be easier to learn. Also, for explaining the basics of matrices and fan triangulation
-
The Cherno: Thanks for his great videos on OpenGL and, overall, for sharing his knowledge on C++ and game engine development!
To report issues, please create an issue here: issue tracker.
If you'd like to contribute, please follow the steps outlined in CONTRIBUTING.md.
This project is licensed under the MIT License.
- SDL - Licensed under the zlib License.
- Glad - Licensed under MIT License.