Question: Base on the recursive algorithm in unit 1 0 section 2 objective 3 , implement a recursive routine in the program of unit 1 1
Base on the recursive algorithm in unit section objective implement a recursive routine in the program of unit section objective to produce a similar reflective effect.
The minimum requirement is to rewrite the method render of the program to implement the recursive ray tracing algorithm. The implemented recursive method should cast a ray from the ray source to the scene. The ray may either hit the wall a nonreflective surface here or hit the floor a reflective surface here If it hits the wall, the method can terminate the recursion and return the local color of the wall. If the ray hits the floor, the method should recursively invoke itself with the reflection ray, and calculate and return the mixed color as demonstrated in the original render routine.
You may hardcode the inclusion test or you may implement your own method to support the inclusion. Also you may need to hardcode the normal vector of the wall and the floor.
Feel free to change the program to suit your needs.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
