Professional Documents
Culture Documents
into a set of pixels for output on a screen. Through this technique you can be able to draw vector images.
To realize this operation have must to activate the display pixels with specific colors to draw the image
requested. The image below will to explain better how work the screen rasterization.
you create an image by looping over all pixels in the image, tracing a ray for each one of these pixels, and
then finding out if these rays intersect any of the objects in the scene. In other words, the algorithm
requires two main loops. The outer loop, iterates over the pixel in the image and the inner loop iterates
over the objects in the scene:
Ray R = computeRayPassingThroughPixel(x,y);
float thit;
if (intersect(R, object, thit)) {
triangleClosest = triangle;
if (triangleClosest) {
Note that in this example, the objects are actually considered to be made of triangles (and triangles
only). Rather than iterating other the objects, we just consider the objects as a pool of triangles and
iterate other the triangles instead.