This repo contains two methods of rendering snowman as part of my computer graphics COL781. The first one is using raytracing and the second one is using rasterization using opengl.
For smooth installation make sure the following libraries are installed:
- GLEW
- OpenGL
- GLFW
- GLM
version 3.0 was used while creating this project.
Run the following command from ray_tracer folder:
g++ main.cpp -lGL -lGLEW -lglfw -o raytracer
- Left and Right arrows should rotate by 15 degrees about a vertical axis.
- Up and Down arrows should rotate by 15 degrees about a horizontal axis.
- 't' key should toggles through scene rotation, ball rotation and light rotation.
- Press 'A' to toggle anti-aliasing (5 rays for now)
- Fresnel + Blinn/Phong illumination model with diffuse, specular and ambient components.
- Recursive depth of 4 (4 intersections), refraction and shadows.
- Anti-aliasing, using up to 16 rays per pixel.
Go to the opengl folder and run the following commands:
make clean
make
cd build
./gapp
- Selecting a background pixel and dragging the mouse rotates the camera (left to right or up to down). If the shift button is simultaneously pressed, the camera should move in camera-Z, depending on the mouse's Y copordinate.
- Selecting a shiny ball and dragging the mouse translates it in Camera-X or Camera-Y (mapped respectively from mouse X and mouse Y).
- Selecting the base sphere of the snowman and dragging rotates the entire snowman about its contact with the ground.
- Selecting the torso of the snowman and dragging should rotate the torso and the head about the base's center.
- Selecting the head of the snowman and dragging should rotate the head about the torso's center.