Ray Tracing (CS6620) - Project 1
You can find the source code here
Here is the required image generated by my raytracer:
Download as png or ppm
Download the scene file
I used the design from the class lectures. I added in the parser and image files that was given to us to build up my classes. I wanted to stick to the 'known' design for now.
Object is the base glass for anything that can be intersected by a ray. Primitives can be anything that have a surface normal and a material. So Spheres, boxes, and rings are Primitives.
All Camera types derive from Camera. I did not add an OrthogonalCamera yet but it will be done soon. Currently the PinholeCamera is the only Camera.
All Light types derive from the Light class, currently I only have a point light.
I'm currently rendering everything in scene. Every time I really interact with the 'world', I do it in scene. So I made methods like traceRay, and traceShadowRay. I even render the scene in scene then draw it to a file in the main method. I'm thinking I might change this around in the future. I used just about everything talked about in class, but I didn't use the scratch pad.
The difficult part of this assignment was getting started. After I built up my project, the tracing part came rather fast. The intersection methods took a little bit of thought, but really I thought the materials were the hardest. Once I understood the materials, I was disappointed by how easy they are. For the most part this assignment was just about re-learning c++ and building a big project. I still want to rearrange a lot of things but I was even considering doing this in C#. I didn't only because people say it's slow compared to c.
I spent around 30 hours on this assignment. I didn't think it was exactly difficult, I just thought we didn't have enough time to finish it. If the assignment would have been posted at the start of the class, I would have been able to focus on the design and not try to hack things together.
Cone of spheres
I made a .scn generator in C# then built a loop that creates spheres along a cone. There are 11 random materials, 3 lamb, 4 phon, and 4 metals. The ground plane is metal and the plane on the side is lamb. That is pretty much all there is to it, but the scene generator took some time.
Download as png or ppm
Download scene file
I shouldn't exactly be posting this since it is wrong, but I posting it would make it easy for someone to tell me what they think I'm doing wrong. Obviously it's stretching it in the up direction. I made my ortho camera by specifying a eye, lookat, and up vector just like the pinhole. I chose to do it this way rather then the u v vectors because it is easier to set up the camera. The position and lookat are the same as the pinhole camera in the project required scene.
Download as png