Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members | Related Pages

PointLight Class Reference

PointLight defines a point light source at a 3D location in the local coordinate system. More...

Inheritance diagram for PointLight:

LightNode ChildNode Node Object SpotLight List of all members.

Detailed Description

PointLight defines a point light source at a 3D location in the local coordinate system.

Point lights operate in a sphere around the light, so the farther you get from it, the "wider" the range of normals lit. At infinite distance, the point light approximates a directional light.

Authoring Interface:

        PointLight {
            field   SFVec3f location    0 0 0
            field   SFVec3f attenuation 1 0 0
            field   SFFloat radius      100
                    // from LightNode
            field   SFBoolean   on              true
            field   SFColor3f   color           white
            field   SFColor3f   specularColor   white
        }

Parameters:
location specifies the position of the center of the light, in local coordinate space. Default value: 0 0 0
attenuation specifies, using 3 coefficients, how the PointLight node's illumination falls off with distance. Parameters are constant, linear and quadratic: constant The constant factor in the attenuation formula: 1.0 means never attenuate, 0.0 is complete attenuation linear The linear factor in the attenuation formula: 1 means attenuate evenly over the distance quadratic The quadratic factor in the attenuation formula: adds a curvature to the attenuation formula. Default value: 1 0 0
radius specifies how far from its location a PointLight node illuminates geometry. Default value: 100
on specifies whether geometry will be illuminated from this source. Default value: true
color specifies the spectral color properties of the direct light emission. Default value: white
specularColor specifies the spectral color properties of the specular illumination component. Default value: white

Functionality:

PointLight defines a point light source at a 3D location in the local coordinate system. A point light source emits light equally in all direction; that is, it is omnidirectional. PointLights are specified in the local coordinate system and are affected by ancestor transformations.

With r as the distance from the light to the surface that is being illuminated, the attenuation factor is evaluated as follows:

        1/max(attenuation[0] + attenuation[1] * r + attenuation[2] * r^2, 1)
In other words, the three components of the attenuation value provide the constant, linear, and quadratic coefficients of the attenuation equation. The default (1, 0, 0) provides no attenuation. An attenuation value of (0, 0, 0) is identical to the default. attenuation component values must be greater than or equal to zero.

Both radius and position are affected by the transformations of ancestors (scales affect radius, and transformations affect position). The value of the radius field is always positive.

For further details on the lighting model, see Lighting.
XXX verify with Ogre's lighting model, and revise to match.


Generated on Sat Apr 1 06:08:09 2006 for Emma Content Development Kit by  doxygen 1.4.3