Several assignments, including ray casting, particle sims and shader pipelines https://github.com/IDLab-MEDIA/cg-01-tdpeuter
This repository has been archived on 2024-12-30. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Find a file
2024-10-11 13:54:48 +02:00
.github GitHub Classroom Feedback 2024-09-26 12:56:49 +00:00
correct_results Initial commit 2024-09-26 09:17:55 +00:00
data Initial commit 2024-09-26 09:17:55 +00:00
docs Initial commit 2024-09-26 09:17:55 +00:00
eigen Initial commit 2024-09-26 09:17:55 +00:00
include Initial commit 2024-09-26 09:17:55 +00:00
src chore: Move inverted logic to viewing_ray from main 2024-10-11 13:30:47 +02:00
test test: Add diff tests 2024-10-11 13:54:48 +02:00
.gitignore chore: Add astyle to gitignore 2024-10-04 14:27:21 +02:00
.gitmodules Initial commit 2024-09-26 09:17:55 +00:00
01_RayCasting.html Initial commit 2024-09-26 09:17:55 +00:00
CMakeLists.txt Initial commit 2024-09-26 09:17:55 +00:00
main.cpp chore: Move inverted logic to viewing_ray from main 2024-10-11 13:30:47 +02:00
README.md Initial commit 2024-09-26 09:17:55 +00:00

Computer Graphics Lab1 - Ray Casting

Deadline: Oct. 11 2024, 22:00

Welcome to the GitHub repository for the first Computer Graphics assignment. This readme contains some additional information on the GitHub Classroom system, and how to compile, build, and execute your code. The actual Ray Casting assignment can be found in 01_RayCasting.html. Good luck!

What is GitHub Classroom?

This feature allows us the create 1 "template" repository with the unsolved assignment, that can be cloned by every student. Once the student makes some local changes and pushes them back to GitHub, they create their own, private repository that can only be accessed by them and us, the teaching staff. In short, you have all the version control benefits of Git, while we can easily collect submissions at the deadline.

Submission

While you are working on the assignment, feel free to push your changes to GitHub for version control. Before the deadline, push your final changes to the remote GitHub repository. Changes made after the deadline will not be taken into account during grading.

The .gitignore makes sure that your bin/ or build/ or Visual Studio specific folders don't get pushed. We don't need those, only your C++ files in src/ and include/.

Running your code on a .json file from the data/ folder results in 3 files: depth.png id.png and normal.png. If these do not look exactly like the files in correct_results/ folder, there is something wrong with your implementation and you will lose points.

Building the project using CMake

In short, CMake makes sure that all the necessary source files and libraries are included during the compiling and building of your executable. It knows which files to include by reading the CMakeLists.txt file. Go ahead and have a quick look at CMakeLists.txt before you continue.

Linux (or WSL on Windows)

Install CMake (and GCC if this was not the case already, since you will need a C++ compiler). Open a terminal and navigate to the directory containing the CMakeLists.txt. Now run:

mkdir build
cd build
cmake ..
make

If everything goes well, make has built the executable file ./raycasting (might require sudo chmod +x <filename>). If you make changes to the files in /src, simply re-run make to rebuild the executable.

MacOS

See the previous section. You can use the C++ compiler in XCode for example.

Windows

(We use Visual Studio as an example, but feel free to use other software.)

Install Visual Studio (!= Visual Studio Code, which does not have a C++ compiler by default). If you are unsure whether or not your installation is sufficient, open the Visual Studio Installer, click "Modify" and make sure the checkbox of "Desktop development with C++" is checked.

Open Visual Studio. On the right side, click "Continue without code". In the top-left corner, choose "File > Open > CMake.." and in the file explorer, select the CMakeLists.txt file of the assignment. This will set up your project in Visual Studio. After waiting a bit, you should see a terminal opening at the bottom, running CMake. Check if there are errors. If not, you can find the /src folder in Visual Studio's "Solution Explorer" on the left. Open it and click on one of the cpp files to start coding.

To build and run the project, click "Build > Build Solution" or press F7. If there are build errors, they will appear at the bottom of Visual Studio. If not, then the executable file raycasting.exe should have been created somewhere in a subdirectory. Open a terminal (also called command prompt), navigate to the folder with raycasting.exe and run the .exe file from there.

Important! Debug vs. Release mode

By default, the executable is built in Debug mode, which allows for debugging but runs slow, especially for data/bunny.json. Speed things up by switching to Release mode.

Linux/MacOS/WSL for Windows: instead of cmake .. run cmake .. -DCMAKE_BUILD_TYPE=Release

Windows: In Visual Studio, at the top, click on the drop-down next to x64-Debug and click Manage Configurations.. (as shown below). Then click the green plus sign on the left, choose x64-Release, and type Ctrl+S to save. You can now switch between x64-Debug and x64-Release. Rebuild.

Manage Configurations..