Advanced computer graphics project, (illumination)

Job ID: 34956060

Budget: ₹600 – ₹1,500 INR

Your program should be resistant to errors and should not segfault or produce undefined behavior. If an error occurs, it should print a message to stderr with “Error:” prefixed to a descriptive error message before returning a non-zero error code. I have a test suite designed to test the robustness of your program.
Your program, raycast, should have this usage pattern:
raycast width height input.csv output.ppm
The CSV data file should support all the primitives from Project 2 and should implement a new light primitive. Examples of the fields for lights follow:
camera, width: 2.0, height: 2.0
sphere, radius: 2.0, diffuse_color: [1, 0, 0], specular_color: [1, 1, 1], ↩
position: [0, 1, -5]
plane, normal: [0, 1, 0], diffuse_color: [0, 1, 0], position: [0, -1, 0] light, color: [2, 2, 2], theta: 0, radial-a2: 0.125, radial-a1: 0.125, ↩
radial-a0: 0.125, position: [1, 3, -1]
Specifically, these properties should be supported for lights:
position
color
radial-a0
radial-a1
radial-a2
theta
angular-a0
direction
The location of the light
The color of the light (vector)
The lowest order term in the radial attenuation function (lights only) The middle order term in the radial attenuation function (lights only) The highest order term in the radial attenuation function (lights only) The angle of the spotlight cone (spot lights only) in degrees;
If theta = 0 or is not present, the light is a point light;
Note that the C trig functions assume radians so you may need to do a conversion.
The exponent in the angular attenuation function (spot lights only) The direction vector of the spot light (spot lights only)
1

If direction is not present, the light is a point light
For objects, the properties from the last assignment should be supported in addition to:
diffuse_color The diffuse color of the object (vector) specular_color The specular color of the object (vector)