



















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




















































11
pixel
(x,y) Construct
a^ ray
from^
the^ eye
Docsity.com
ob->intersect(ray, hit, tmin);Color col=ambient*hit->getMaterial()->getDiffuse();For every light L Ray^ ray2(hitPoint,
L->getDir());
Hit^ hit2(L->getDist(),,)
For^ every
object
ob ob->intersect(ray2,
hit2,^
If^ (hit->getT>
L->getDist()) col=col+hit->getMaterial()->shade(ray,
hit,^ L->getDir(),
L->getColor());
Return^
col;
ob->intersect(ray, hit, tmin);Color col=ambient*hit->getMaterial()->getDiffuse();For every light LRay^ ray2(hitPoint,
L->getDir());
Hit^ hit2(L->getDist(),,)
For^ every
object
ob ob->intersect(ray2,
hit2,^
epsilon
If^ (hit->getT>
L->getDist()) col=col+hit->getMaterial()->shade(ray,
hit,^ L->getDir(),
L->getColor());
Return^
col;