Skip to content

My C++ project this summer creating a ray traced picture following the Ray Tracing in One Weekend and the Next Week

Notifications You must be signed in to change notification settings

cekcreator/Ray_Tracing_Proj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation


None

Ray Tracing algorithm following Peter Shirleys books

Following Peter Shirley's "Ray Tracing the in One Weekend", and "Ray TRaving the Next Week", I created a ray traced image adding my own twist of the two coding languages I use the most.

About The Project

I added in both the Perlin blurring and different coding logos for the generated spheres. I was able to add the jpg logos for the coding by utilizing a library called stb. STB is a C++ library commonly used for images and 3d images in C++. I then went on into ray tracings' second book to figure out how to create the Perlin blurring. The Perlin blurring takes in a 3d point and then returns a similar randomized number. I then smoothed out the blurring using one of the recommended techniques from the book. The technique I used was called “Hermitian smoothing”. For the texture mapping, I had to add functionality to store all the RGB values and scale them, I then calculated the mapping from the 2d image to the 3d object by mapping the surface point and the hit point from the 2d texture info. After that, I changed the view coordinates to get a better view of what I had changed. I finally then randomized the number of spheres. The code may take a bit to run but the executable is there incase of any compiler issues.

(back to top)

Checking it out

Prerequisites

You'll need a c++ compiler on your system, I recommend g++ as it's what I use.

Installation

  1. Clone the repo
    git clone https://github.com/cekcreator/Ray_Tracing_Proj.git
  2. cd into src
    cd src
  3. Run the cli command to create the picture
    g++ -std=c++11 test.cpp -o test 
  4. Excute the generated executable and feed it into a ppm file
    ./image > image.ppm 

(back to top)

Contact

Caleb Kumar - https://www.linkedin.com/in/caleb-k-0232b719b/

Project Link: https://github.com/cekcreator/Ray_Tracing_Proj

(back to top)

Acknowledgments

(back to top)

About

My C++ project this summer creating a ray traced picture following the Ray Tracing in One Weekend and the Next Week

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published