https://github.com/hekoh99/miniRT
The miniRT project is an implementation of a ray tracer that visualizes 3D scenes based on specified input files. The ray tracer generates images by simulating the interaction of rays with objects in the scene. The input files provide details about the scene's ambient light, camera, light sources, and various shapes like spheres, planes, and cylinders.
The input file contains information about the scene's setup and objects. Here’s an example of how the file is structured:
A 0.2 255,255,255
C -50,1,20 1,0,0 70
L -40,0,30 0.7 255,255,255
sp 0,-10,10 20 255,0,0
pl 0,-20,0 0,1.0,0 100,100,100
cy -10.0,-10.0,0.0 0.0,1.0,0.0 14.2 21.42 10,0,255
cy 0.0,-10.0,30.0 0.0,1.0,1.0 14.2 21.42 10,0,255
A <ratio> <color>
A 0.2 255,255,255
ratio
: Intensity of the ambient light.color
: RGB values of the ambient light.C <position> <orientation> <field_of_view>
C -50,1,20 1,0,0 70
position
: Position of the camera in 3D space.orientation
: Orientation vector of the camera.field_of_view
: Field of view of the camera.L <position> <intensity> <color>
L -40,0,30 0.7 255,255,255
position
: Position of the light source.intensity
: Light intensity.color
: RGB values of the light.sp <center> <diameter> <color>
sp 0,-10,10 20 255,0,0
center
: Center of the sphere.diameter
: Diameter of the sphere.color
: RGB values of the sphere.pl <point> <normal> <color>
pl 0,-20,0 0,1.0,0 100,100,100
point
: A point on the plane.normal
: Normal vector of the plane.color
: RGB values of the plane.cy <base> <orientation> <height> <radius> <color>
cy -10.0,-10.0,0.0 0.0,1.0,0.0 14.2 21.42 10,0,255
base
: Base center of the cylinder.orientation
: Orientation vector of the cylinder.height
: Height of the cylinder.radius
: Radius of the cylinder.color
: RGB values of the cylinder.Output