C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解
Read over all the code and attempt to understand what each line does (don't worry too much about 'ballpos' or 'makeScene' in 'RayTracer.java'). You may be asked questions about this when your lab is marked.
Modify the 'raytrace' method in 'Scene.java' such that it's illumination model includes both diffuse and specular reflection. This may be from a single light source. You should adjust lighting parameters such that both the diffuse and specular effects are viewable. Make a note of the formula you used for your illumination model.
Note, you do not need to trace rays to the light sources in this part of the lab. Hence you should not see shadows.
Add two large mirror spheres to the scene. Let these mirrors act as perfect reflectors. Enable rays to reflect off these mirrors a number of times.