This project demonstrates 2D Raytracing and Raycasting simulations using OpenGL and GLUT in C++. The program is divided into three parts, each handling a distinct unit of the simulation.
The following libraries are required to build and run the program:
- FreeGLUT - OpenGL Utility Toolkit for rendering:
- GLEW (Optional) - Manages OpenGL extensions:
The project contains three scripts, each corresponding to a unit of the simulation:
-
one.sh
Builds and runs the first unit of the program, which is stored in the/builds/one
directory. -
two.sh
Builds and runs the second unit of the program, which is stored in the/builds/two
directory. -
three.sh
Builds and runs the third unit of the program, which is stored in the/builds/three
directory.
-
Clone the repository:
git clone https://github.com/ItsAash/comp342_raytracing cd comp342_raytracing
-
Installing Dependencies: For debain/ubuntu systems:
sudo apt-get install freeglut3 freeglut3-dev
For macOS:
brew install freeglut
- Make the script executable:
chmod +x one.sh two.sh three.sh
- Run the desired Unit:
./one.sh
or
./two.sh
or
./three.sh
- This unit simulate the source of the ray, emitting ray in all direction, and checking whether the ray intersects will any wall. This demonstration simulates the visibility of the ray is 0 beyond the wall.
- This unit simulates a 2D rays around the 2D world, and generate a 3D world based on the intersection of the Rays.
© Ashish Neupane 2024