Target, TargetX, TargetY, TargetZ

Target point of a light

Value Summary

TargetLibrary wrapper for "[TargetX, TargetY, TargetZ]" (3D)List of 2 or 3 expressions, depending on the dimension
TargetX, TargetY, TargetZMandatoryMuPAD® expression

Graphics Primitives

ObjectsDefault Values
plot::DistantLight, plot::SpotLight 


The Target attribute refers to the point a spot light is aimed at. It also controls the direction of a distant light which is given by the vector Target - Position.

Target sets the position of the point lights of type plot::DistantLight and plot::SpotLight are aimed at. TargetX etc. refer to the single coordinates of this point.

The value of Target is a list or vector of coordinates. 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 CameraCoordinates = TRUE, the light source is fixed to the camera. It moves automatically, when the camera is moved.


Example 1

When generating lights of type plot::DistantLight and plot::SpotLight, the second argument ist the Target. In the following expample, it is animated:

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 by the Target attribute:

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:

See Also

MuPAD Functions

Was this topic helpful?