Target point of a light
The value of
Target is a list or vector of
TargetX = x etc. refer to the single
coordinates of this list.
These attributes can be animated.
By default, the positions and the targets of light objects are given in model coordinates that have nothing to do with the camera that is used to view the scene.
When using the attribute
the light source is fixed to the camera. It moves automatically, when
the camera is moved.
sunlight := plot::DistantLight([0, 0, 2], [cos(a), sin(a), 1], a = 0..2*PI): spotlight := plot::SpotLight([0, 0, 1], [cos(a), sin(a), 1/2], PI/5, a = 0..2*PI): sunlight::Target, spotlight::Target
We illuminate a paraboloid with sunlight. Its direction is animated
f := plot::Function3d(x^2 + y^2, x = -1..1, y = -1..1): plot(f, sunlight, CameraDirection = [-1, -2, 6])
We use the animated spot light:
plot(f, spotlight, CameraDirection = [-1, -2, 6])
delete sunlight, spotlight, f: