The functionality is
implemented in the |
![]() |
light class returns a null directional component. So
that particular surface point is not painted an thus appears as in shadow.
For this part of the Raytracer the directionalLight class
has to be altered, as the illumination is not done by the object of the scene but by the
different light sources. To make use of a second type of light source, the point light,
it would be necessary to implement the illumination method .
This wasn't done by me as the scenes only consisted of spheres in directional light, but
it would be a could exercise for everyone to get to knoe illumination.
|
![]() |
PhongMaterial
. If the current surface point does not lie in shadow a ray is casted in opposite to the
direction the light comes from. It's tested wether there is any object in the way. If so the objects
colour is partly added to the current point's colour. Recursive reflection is implemented up to a
boundary of depth five. The implementation would do more, but more is not necessary as one can't
recognise reflections of order three.
|
![]() |
eMail me! :)