a program that builds a 3D image using ray tracing algorithm
Hello everybody! This project is a class-task in my seconed year at jct college.
NOTE: The porpose of this task was to have an experiense in software engeneering, and not for a perfect image result!
I've build the project step-by-step with the lecture guide throughout the first semester in this year. The project has been designed using a bunch of design patterns (including: Agile, TDD, Builder, Composite etc)
Here is some details on the project packages:
PRIMITIVES: This package holds the code for primitives objects (objects with no shape), That helps the program calculate the space. Includes classes for:
- coordinates
- 2D points
- 3D points (inherits from 2D points)
- Vectors
- Rays (inherits from Vectors) As the project progressed i added 2 more classes (Agile design) for the object features.
- Colors (a different class from the java library for ease of use)
- Material
GEOMETRIES: This package holds the code for some shapes. For each shape there is a spacial calculation for getting the intersection point with the ray. Includes classes for:
- geometry (abstract class)
- radial geometry (abstract class, inherits from geometry)
- plane (inherits from geometry)
- triangle (inherits from plane)
- rectangle (inherits from plane)
- sphere (inherits from radial geometry)
- geometries (a collection to hold all the geometries in an image)
- intersectable (interface implemented by all the classes)
ELEMENTS: This package holds the code for other elements in the image. Includes classes for:
- camera (for the point of view)
- ambient light (the general color of the image)
- light source (interface implemented by the next classes)
- light (abstract class)
- directional light (inherits from light)
- point light (inherits from light)
- spot light (inherits from point light)
SCENE: This package holds the code for integrate and locate all the elements into a scene. Includes class for:
- scene (a collection of shapes lights and camera)
RENDERER: This is the most important package in this program. Here is where all the calculations performed and the image constructed. includes classes for:
- image builder (the "painter" of the image)
- renderer (the calculator and compositor of the image). ! This renderer designed especially for a "glossy surface" result !