9-10XIST
Directional
void setup() {
size(640, 360, P3D); //(x,y,z)
noStroke();
fill(204);
}
void draw() {
noStroke();
background(64);
float dirY = (mouseY / float(height) - 0.5) * 2;
float dirX = (mouseX / float(width) - 0.5) * 2;
directionalLight(255, 204, 153, -dirX, -dirY, -1);
translate(width/2 - 100, height/2, 0); //(x,y,z)
sphere(80);
translate(200, 0, 0);
sphere(80);
}
Code

Image
Video Demonstration
Moving the mouse changes the direction of the light. Directional light appears from one direction and is weaker when it hits at a gentler angle. After hitting a surface, the directional light scatters in all directions. This code demonstrates this concept by using technology. It shows how technology and real-life can be connected as one. I experimented with changing the colour of the light, the background colour, colour of the sphere and the sizing of the spheres. I ended up choosing this orange colour to represent the warmness of the light and black for the colour of the sphere. I chose black because I felt that the concept of directional light could be best understood with a darker background. This is another interactive code which is simple, but educational. It can be used to teach people about directional light. The main function that is used in this exercise, hence the name is directionalLight(). It also uses the functions translate() and sphere().
(click the functions underlined to learn more about them)