Finished the calculation of the ray tracing.