Changes

Jump to: navigation, search

Studyapplocator

558 bytes added, 23:26, 10 March 2018
Profile generated
}
}
 
Another area that will be speed up the program would be the render function
 
for (unsigned y = 0; y < height; ++y) {
for (unsigned x = 0; x < width; ++x, ++pixel) {
float xx = (2 * ((x + 0.5) * invWidth) - 1) * angle * aspectratio;
float yy = (1 - 2 * ((y + 0.5) * invHeight)) * angle;
Vec3f raydir(xx, yy, -1);
raydir.normalize();
*pixel = trace(Vec3f(0), raydir, spheres, 0);
}
}
 
This function traces the rays for each pixel of the image traces it and returns a color.
= Assignment 2 =
45
edits

Navigation menu