Saturday, January 7, 2017

Tutorial Post 8: Light.

Tutorial Post 8: Light.


The final color of the pixel on the screen is its RGB color vector multiplied by its brightness which is a factor with a value between zero and one. Edges are displayed in their full brightness (i.e. brightness=1.0). The brightness of the triangle is a sum of two components: 
  • a fixed ambient component (default initial value is 0.2)
  • a directional component
The value of the directional component depends on the angle between the direction of the directional light and the plane of the triangle. The more perpendicular the triangle is to the direction of of the light, the greater is the value of directional component of its brightness. 

Initially the directional light is parallel to the Z axis af the model space:


When the model is rotated, you can see the sides that are parallel to the direction of the light (they have only ambient component of the brightness):


You can set the direction of the light to the direction you are looking at, by pressing the sequence of the keys 'QDL' (i.e. 'L' key on data sub-menu):


No comments:

Post a Comment