This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


plot::PointLight([x, y, z], <intensity>, <a = amin .. amax>, options)


plot::PointLight([x, y, z], intensity) generates a point light at the position (x, y, z).

Each 3D scene is illuminated by several light sources that are set automatically and cannot be controlled by the user. Cf. the help page of Lighting.

If special light effects are desired, the user can create alternative light sources of various types such as plot::AmbientLight, plot::DistantLight, plot::PointLight, and plot::SpotLight.

If at least one user defined light source is inserted into the scene (e.g., by simply passing the light objects as input parameters to the plot command), the automatic lights are switched off and the user defined lights are used to illuminate the scene.

plot::PointLight([x, y, z], intensity) creates a point light at the position (x, y, z). It emits light into all directions.

Unlike in real life, the light flux of a point light does not decrease with the distance to the light source.

By default, white light is created. Other colors can be chosen by the attribute LightColor.

When using the attribute CameraCoordinates = TRUE, the light source is fixed to the camera. It moves automatically, when the camera is moved.

Light sources such as plot::PointLight create shading effects that add depth to the picture.

Usually, you will use point lights to highlight special details of the scene. For the illumination of the entire scene you will usually need additional undirected ambient light of type plot::AmbientLight, too.

Note that all light sources create a homogeneous lighting effect for a 3D triangle. Thus, realistic shading effects can only be achieved for surfaces with a sufficiently fine triangulation. For function graphs (plot::Function3d) and parametrized surfaces (plot::Surface), a fine triangulation is created by sufficiently high values of XMesh, YMesh or UMesh, VMesh, respectively.


AttributePurposeDefault Value
CameraCoordinatesposition of light sources relative to the camera?FALSE
Framesthe number of frames in an animation50
LightColorthe color of lightRGB::White
LightIntensityintensity of light1.0
Namethe name of a plot object (for browser and legend) 
ParameterEndend value of the animation parameter 
ParameterNamename of the animation parameter 
ParameterBegininitial value of the animation parameter 
ParameterRangerange of the animation parameter 
Positionpositions of cameras, lights, and text objects 
PositionXx-positions of cameras, lights, and text objects 
PositionYy-positions of cameras, lights, and text objects 
PositionZz-positions of cameras, lights, and text objects 
TimeEndend time of the animation10.0
TimeBeginstart time of the animation0.0
TimeRangethe real time span of an animation0.0 .. 10.0


Example 1

We create three blue surfaces and illuminate them by an animated point light. The position of the point light is indicated by a white point:

s1 := plot::Surface([1, y, z], y = 0..1, z = 0..1):
s2 := plot::Surface([x, 1, z], x = 0..1, z = 0..1):
s3 := plot::Surface([x, y, 0], x = 0..1, y = 0..1):
p := plot::Point3d([a, 0.9, 0.2], a = 0..1,
                   PointSize = 2.0*unit::mm,
                   PointColor = RGB::White):
light := plot::PointLight([a, 0.9, 0.2], 1, a = 0..1):
plot(s1, s2, s3, p, light, Axes = Frame,
     FillColor = RGB::Blue, FillColorType = Flat):

delete s1, s2, s3, p, light:


x, y, z

The coordinates of the point light: numerical values or arithmetical expressions of the animation parameter a.

x, y, z are equivalent to the attributes Position, PositionX, PositionY, PositionZ.


The intensity of the light: a numerical value between 0 and 1 or an arithmetical expression of the animation parameter a.

intensity is equivalent to the attribute LightIntensity.


Animation parameter, specified as a = amin..amax, where amin is the initial parameter value, and amax is the final parameter value.

See Also

MuPAD Functions

MuPAD Graphical Primitives

Was this topic helpful?