Opening angle of the light cone of a spot light
|Objects||SpotAngle Default Values|
SpotAngle sets the opening angle of the light cone of a spot light in radians, and defines the opening angle of the light cone emitted by spot lights of type plot::SpotLight.
The values for SpotAngle have to be given in radians. Reasonable value lie between 0 and π.
SpotAngle can be animated.
When creating a spot light, the third argument is the SpotAngle:
spotlight := plot::SpotLight([0, 0, 1], [0, 0, 0], a*PI, 1, a = 0..0.4, LightColor = RGB::White): spotlight::SpotAngle
We illuminate the x-y plane by the animated spot light and some ambient light. The spot light is visualized by a cone:
ambientlight := plot::AmbientLight(0.2): s := plot::Surface([x, y, 0], x = -1..1, y = -1..1, Submesh = [2, 2], Color = RGB::White, FillColorType = Flat): c := plot::Cone(0, [0, 0, 1], 0.6*tan(a*PI/2), [0, 0, 1 - 0.6], a = 0..0.4, Color = RGB::Orange.[0.5]): plot(s, c, spotlight, ambientlight, CameraDirection = [-9, -18, 12])
delete spotlight, ambientlight, s, c: