Skip to content

Vpekdas/scop

Repository files navigation

Scop

Screenshots

scop.mp4

Table of Contents

  1. Description
  2. Installation
  3. Run
  4. Credits
  5. Contributing
  6. License

Description

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.

Purpose

The objective is to create a simple 3D OBJ renderer that displays textures and can rotate along all three axes.

Controls

Camera Movement

Key Action
W Move camera forward
S Move camera backward
A Move camera left
D Move camera right
Rotate camera left
Rotate camera right

Model Controls

Key Action
X Set rotation axis to X
Y Set rotation axis to Y
Z Set rotation axis to Z
Space Stop model rotation

Rendering Modes

Key Action
F1 Point mode
F2 Wireframe mode
F3 Fill mode

Effects

Key Action
F4 Apply texture
F5 Apply dissolve effect
F6 Play Bad Apple

Audio

Key Action
P Play / Pause audio

Global

Key Action
ESC Exit application

Technologies used

  • C++
  • CMake
  • GLSL
  • OpenGL
  • SDL3

Challenges and Future Features

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.

Installation

  • Ensure you have a C compiler installed, such as Clang or GCC
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 Release

Note

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.

Run

  • 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]

Credits

  • 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!

Contributing

To report issues, please create an issue here: issue tracker.

If you'd like to contribute, please follow the steps outlined in CONTRIBUTING.md.

License

This project is licensed under the MIT License.

Third-Party Licenses

About

Scop is a project that involves building a simple 3D OBJ viewer by using graphical API with texture support and real-time rotation on all axes.

Resources

License

Contributing

Stars

Watchers

Forks

Contributors