Home | All Classes | Grouped Classes | Index | Search

CL_LightSource::set_position

Sets the light position.

	void set_position(
		const CL_Vector& position);

Detailed description:

The position is transformed by the modelview matrix when glLight is called (just as if it were a point), and it is stored in eye coordinates. If the w component of the position is 0.0, the light is treated as a directional source.

Diffuse and specular lighting calculations take the lights direction, but not its actual position, into account, and attenuation is disabled. Otherwise, diffuse and specular lighting calculations are based on the actual location of the light in eye coordinates, and attenuation is enabled.

The default position is (0,0,1,0); thus, the default light source is directional, parallel to, and in the direction of the –z axis.

See also:

CL_LightSource | CL_Vector



Questions or comments, write to the ClanLib mailing list.