Graphics Lighting Transformation
Graphics Lighting Transformation
A sphere can be transformed into a spheroid by either a scale transformation or by changing the plot range while keeping the bounding box ratios constant. These transformations are specified by the spheroid control setting, which gives the vertical over horizontal semi-axis ratio of the resulting spheroid. A control setting less than 1 gives an oblate spheroid, greater than 1 a prolate spheroid, and equal to 1 an untransformed sphere.
Though a scale and a plot range transformation can generate the same spheroid, these transformations differ in their effect on lighting. The scale transformation leaves the lighting direction fixed, but the plot range transformation applies the same transformation to both the sphere and the light source. This distinction is shown by introducing two light sources: a fixed cyan light source that is excluded from the sphere to spheroid transformation and a transformed magenta source that is included in the transformation.
The light angle control specifies a 0 to radian inclination angle of these light sources before any transformation. The cyan light source direction is simply specified by the light angle control without any transformation effect and is thus independent of the spheroid control setting. On the other hand, the magenta light source direction is determined by applying the spheroid transformation to a lighting direction vector with an inclination angle specified by the light angle control. This magenta lighting direction thus depends on both spheroid and light angle control settings.
π
The cyan and magenta light sources have the same direction if the light angle is 0, /2, or , or if the spheroid setting is 1, which are all situations where the spheroid transformation does not change the direction of the magenta source. The light source control toggles the light sources on and off. The cyan source is controlled by the fixed button, so named because this light source does not transform, and the magenta light source is controlled by the transformed button, so named because this source is transformed.
π
π
The diffuse reflected light intensity of a surface that obeys Lambert's law depends on the cosine of the angle between the surface normal and the light source direction. This means that the surface appears brightest at the point where a light source is normally incident. The normal incident points for the fixed cyan light source and transformed magenta light source are indicated by cyan and magenta arrows on the spheroid's surface. It is evident that even though the lighting direction of the cyan source is fixed by the light angle control, its point of normal incidence on the spheroid varies with the spheroid control setting.