In this assignment, we try to speed up ray tracing by reducing the number
of intersection checks we have to make for each ray. I chose the uniform
grid data structure . The grid has the following characteristics:-
Let N = the number of objects
del_x * del_y *del_z: the dimensions of each square od the grid
n_x * n_y * n_z: the total number of grids.
Then the following properties are satisfied:-
I used the UNIX 'time' command to measure the execution time of the
process. I ran the process on Jacoby (MIPS R4400 with 128 Meg memory).
Here are the results
| Number of Spheres (N) | Pre-processing time (seconds) | Ray tracing time (seconds) | Total time (seconds) |
| 1 | negligible | 1.0 | 1.0 |
| 10 | negligible | 2.6 | 2.6 |
| 100 | negligible | 4.9 | 4.9 |
| 1,000 | negligible | 7.9 | 7.9 |
| 10,000 | 0.1 | 13.1 | 13.2 |
| 100,000 | 2.6 | 25.1 | 29.1 |
| 1,000,000 | 26.277 | 110.900 | 127.177 |
N=1
![]() |
N=10![]() |
N=100
![]() |
N=1,000![]() |
N=10,000
![]() |
N=100,000![]() |
N=1,000,000
![]() |