Next: Miscellaneous Sphere Drawing Commands, Previous: Data Flows for Drawing Spheres, Up: Usage of Sphere Drawing
The equation for determining the intensity of a particular pixel is as follows:
_ _ _ _ G I = I + (I - I ) (K N . L + K (R . O) LOW HI LOW D S where I minimum intensity for a pixel. This provides for LOW an ambient light level. Defaults to 10. I maximum intensity for a pixel. Useful if the HI display saturates below 255. Defaults to 255. K coefficient of diffusive reflection, ie. uniform D scattering of light. Defaults to 0.5. K coefficient of specular reflection, ie. where S light reflects in a particular direction. Defaults to 0.5. _ Unit normal vector of the sphere's surface at the pixel N coordinate. _ Unit vector pointing to the light source. Defaults to L (0,0,1). A vector of (0,0,-1) is perfect backlighting which sets all pixels to I . (0,1,0) gives right lighting. LOW _ Unit vector giving the reflected light vector off the R surface. Computed as follows: _ _ _ _ _ R = 2 N . L N - L _ Vector to observer. This is preset to (0,0,1) O so that the observer is at z = infinity G Glossiness exponent. This controls how accurately the reflected light vector must point toward the observer. Low values (3-6) give a metallic appearance. Larger values (30-100) give a more plastic appearance. Defaults to 6.
All negative dot products are converted to zero which models the opacity of the surface.
The commands for manipulating the shading parameters are as follows:
Sets the lighting range. I is set to the first argument. LOW I is set to the second argument. The range of permissible HI values are 0 to 255.