In this project, I implemented the complex concept of radiosity in order to create a simple image of three sides of a cube. This involved the creation of multiple programs as well as multiple files for these individual programs.
This project involved implementing radiosity to create a simple image. Radiosity involves calculating how much energy every surface absorbs and how much it emits in order to calculate the amount of energy at that surface. First of all, I had to create a file that had all of the polygons in the scene with their vertices and their individual colors. Then, I had to make a top level program that calculated the form factors from all of the polygons in the scene. Then I needed to create a program that read in a polygon file and a form factors file and set up the radiosity matrix to calculate the radiosity values for each polygon. Finally, I needed to create a program that took the radiosity values and use them to color the polygons in my scene.
Firstly, I created a program that created 300 polygons, 100 for each side and assigned their indices and colors to a line in a file. Next I created a program that read in this polygon file, created a scene containing each of the polygons after assigning ever polygon a unique ID. Then, for each polygon, I made five renderings of the scene from different views. Then these images, I calculated the form factors Fij for each polygon. Then I stored these form factors in a file. The next program took in the polygon file and the form factors and created the radiosity matrix. I did this in python because it was much easier to create matrices and use these matrices to generate the values I needed. The program calculated the values using Gaus-Seidel iteration and then wrote the values to another file. Finally, I created a program to take in the radiosity file, clip the radiosity values accordingly and generate an .ppm image.
The animation above shows how a the three sides of a cube area illuminated through the movement of light through the scene. The white square at the top is the emitter and the rest of the cube is blue.
In conclusion, this was a very challenging project to handle and I will definitely look forward to working more on radiosity in the future.