Download oCOSMO 3D User's Manual
Transcript
Chapter 8: Lighting and Fog csLight csLight is an abstract base class for light sources. It provides the following methods for setting light values: void void void void void setOn(csBool on); setIntensity(csFloat intensity); setAmbientIntensity(csFloat ambientIntensity); setColor(const csVec3f& color); setColor(csFloat v0, csFloat v1, csFloat v2); There is a corresponding set of get...() methods that return each of the light settings. setOn() turns on the csLight object. setIntensity() sets the brightness of the csLight object. setAmbientIntensity() sets the brightness of the ambient color. The ambient intensity is how bright the light makes all objects appear. setColor() sets the color of the csLight object. csDirectionalLight csDirectionalLight is a directional light source that approximates distant light sources, such as the sun, and can improve rendering performance over local light sources, such as csPointLight and csSpotLight. Use csDirectionalLight to set the direction of general lighting for a scene using one of the following methods: void setDirection(const csVec3f& direction); void setDirection(csFloat v0, csFloat v1, csFloat v2); There is a corresponding set of get...() methods that return the lighting direction. A csDirectionalLight has no range limitations so it affects all children of a csEnvironment object when included in a light array. Note: A csDirectionalLight object’s direction is affected by all csTransform nodes above it in the scene hierarchy. 90
Related documents