PointLight[col,pt]
is a three-dimensional graphics directive that specifies the point light of color col at position pt to use in coloring 3D surfaces.
PointLight[col,pt,att]
uses the point light with geometric attenuation att.
PointLight
PointLight[col,pt]
is a three-dimensional graphics directive that specifies the point light of color col at position pt to use in coloring 3D surfaces.
PointLight[col,pt,att]
uses the point light with geometric attenuation att.
Details
- PointLight is also known as spherical point light.
- PointLight is typically used to illuminate certain sections of an object by casting light rays that spread evenly in all directions.
- PointLight[col,pt] yields a light that emanates from the point pt but does not attenuate with distance.
- Colors of light sources col can be defined by RGBColor, Hue or any other color specification.
- The setting for PointLight affects only colors associated with diffuse and specular reflection on a 3D surface.
- Light sources with color specifications of the form {dcol,Specularity[scol]} are effectively taken to have colors dcol for purposes of diffuse reflection, and scol for purposes of specular reflection.
- Diffuse reflection is taken to follow Lambert's law, with light effectively scattered equally in all directions from a surface.
- Specular reflection effectively takes light to be scattered only close to the mirror‐reflection direction, as specified in the notes for Specularity.
- Light source positions pt can be specified as follows:
-
{x,y,z} explicit coordinates that move with the graphic Scaled[{x,y,z}] scaled coordinates that move with the graphic ImageScaled[{x,y,z}] coordinates fixed relative to the final displayed image - In ImageScaled[{x,y,z}], the
and
run from 0 to 1 across the width and height of the bounding box of the final displayed image. The
coordinate runs orthogonal to the plane of the display, and is 0 at the back of the 3D region and 1 at the front. - Coordinates specified in Scaled and ImageScaled will often not be between 0 and 1.
- PointLight[col,pt,{a,b,c}] yields a light that attenuates like
with distance
.
Examples
open all close allBasic Examples (3)
Graphics3D[{PointLight[Green, {2, 2, 2}], Sphere[], Cuboid[{1, 2, -1}, {2, 3, 1}], Cylinder[{{3, -1, 0}, {3, -1, 1}}]}, Lighting -> None]Plot3D[Sin[x + y ^ 2], {x, -3, 3}, {y, -2, 2}, PlotStyle -> PointLight[RGBColor[1, 0.7, 0.1], {0, 0, 4}]]A point light from the top of the specular surface:
ListPlot3D[RandomReal[1, {9, 9}], InterpolationOrder -> 2, Mesh -> None, PlotStyle -> {Specularity[50], PointLight[RGBColor[1, 0.7, 0.1], {5, 5, 4}]}]Scope (7)
Lighting Specification (4)
Specify a spherical point light source by a color and a position:
Graphics3D[{PointLight[Green, {2, 2, 2}], Sphere[], Sphere[{3, 0, 0}], Sphere[{0, 3, 0}], Sphere[{3, 3, 0}]}, Lighting -> None]Point lights with different colors:
Table[Graphics3D[{PointLight[c, {0, 0, 2}], White, Sphere[]}, Lighting -> None], {c, {Red, Yellow, Blue}}]Point lights at various positions:
Table[Graphics3D[{PointLight[Orange, p], Sphere[]}, Lighting -> None], {p, {{2, 0, 0}, {0, -2, 0}, {2, -2, 0}, {0, 0, 2}}}]Point lights on specular surfaces:
Table[Graphics3D[{PointLight[Orange, p], Specularity[White, 50], Sphere[]}, Lighting -> None], {p, {{2, 0, 0}, {0, -2, 0}, {2, -2, 0}, {0, 0, 2}}}]Lighting Positions (2)
Specify the light source position in the graphics coordinate system by default:
Graphics3D[{PointLight[Red, {2, 0, 0}], PointLight[Green, {0, -2, 0}], PointLight[Blue, {0, 0, 2}], Sphere[]}, Lighting -> None]The light source moves with the graphic when the viewpoint changes:
Table[Graphics3D[{PointLight[Red, {2, 0, 0}], PointLight[Green, {0, -2, 0}], PointLight[Blue, {0, 0, 2}], Sphere[]}, Lighting -> None, ViewPoint -> v], {v, {{0, -2, 2}, {2, 0, 2}, {2, -2, 0}}}]Specify the light position by a fraction of the graphics coordinates using Scaled:
Graphics3D[{PointLight[Red, Scaled[{2, 0, 0}]], PointLight[Green, Scaled[{0, -2, 0}]], PointLight[Blue, Scaled[{0, 0, 2}]], Sphere[]}, Lighting -> None]The light source moves with the graphic when the viewpoint changes:
Table[Graphics3D[{PointLight[Red, Scaled[{2, 0, 0}]], PointLight[Green, Scaled[{0, -2, 0}]], PointLight[Blue, Scaled[{0, 0, 2}]], Sphere[]}, Lighting -> None, ViewPoint -> v], {v, {{0, -2, 2}, {2, 0, 2}, {2, -2, 0}}}]Lighting Attenuation (1)
By default, point lights are not affected by the distance from an object:
obj = Table[Sphere[{3i, 0, 0}], {i, 0, 4}];Graphics3D[{PointLight[White, {24, 0, 0}], obj}, Boxed -> False, Background -> Gray, ViewPoint -> {1.5, -1, 0}, Lighting -> None]Specify a point light that attenuates with respect to the distance:
Graphics3D[{PointLight[White, {24, 0, 0}, {0, 1, 0}], obj}, Boxed -> False, Background -> Gray, ViewPoint -> {1.5, -1, 0}, Lighting -> None]Specify a point light that attenuates by the square of the distance:
Graphics3D[{PointLight[White, {24, 0, 0}, {0, 0, 0}], obj}, Boxed -> False, Background -> Gray, ViewPoint -> {1.5, -1, 0}, Lighting -> None]Generalizations & Extensions (2)
Specify lighting for each object:
o1 = Style[{PointLight[Red, {0, 0, 2}], Sphere[]}];
o2 = Style[{SpotLight[Yellow, {{3, 0, 2}, {3, 0, 0}}, Pi / 8], Sphere[{3, 0, 0}]}];
o3 = Style[{DirectionalLight[Blue, {{0, 3, 2}, {0, 3, 0}}], Sphere[{0, 3, 0}]}];
o4 = Style[{PointLight[White, {3, 3, 2}], Sphere[{3, 3, 0}]}];Graphics3D[{o1, o2, o3, o4}, Lighting -> None]Specify lighting within the graphics:
Graphics3D[{{PointLight[Red, {0, 0, 2}], Sphere[]}, {SpotLight[Yellow, {{3, 0, 2}, {3, 0, 0}}, Pi / 8], Sphere[{3, 0, 0}]}, {DirectionalLight[Blue, {{0, 3, 2}, {0, 3, 0}}], Sphere[{0, 3, 0}]}, {PointLight[White, {3, 3, 2}], Sphere[{3, 3, 0}]}}, Lighting -> None]Applications (3)
Set up four white spheres on a plane:
obj = Graphics3D[{Specularity[White, 50], Sphere[], Sphere[{4, 0, 0}], Sphere[{0, 4, 0}], Sphere[{4, 4, 0}]}];
plane = ParametricPlot3D[{u, v, -1}, {u, -2, 6}, {v, -2, 6}, PlotPoints -> 40, MaxRecursion -> 0, Mesh -> None, PlotRange -> 1, Axes -> False];light = Graphics3D[{PointLight[Yellow, {2, 2, 2}], Red, PointSize -> .05, Point[{2, 2, 2}], Glow[Yellow], Opacity[.3], Sphere[{2, 2, 2}, 3]}];Show[light, obj, plane, Boxed -> False]Different light instruments at the corner points:
lights = {PointSize[Large], Yellow, Point[Tuples[{-1, 1}, 3]]};Graphics3D[{PointLight[Hue[RandomReal[]], #]& /@ Tuples[{-1, 1}, 3], lights, Sphere[]}]Build a scene with multiple objects and light sources:
col = {Red, Green, Blue};
objs = Graphics3D[{Specularity[White, 2], EdgeForm[], Cylinder[{{2, 2, 0}, {2, 2, 4}}], Cylinder[{{6, 2, 0}, {6, 2, 4}}], Cylinder[{{10, 2, 0}, {10, 2, 4}}]}];
walls = ParametricPlot3D[{{u, v - 2, 0}, {u, 4, 2v}}, {u, -2, 14}, {v, 0, 6}, PlotPoints -> 15, MaxRecursion -> 0, PlotStyle -> Specularity[White, 2], Mesh -> None, Axes -> False];
srcs[pos_] := Graphics3D[MapThread[{DirectionalLight[#1, {{0, -1, 0}, {0, 0, 0}}], Sphere[{#2, 0, 8}, .3]}&, {col, pos}]];
lights[pos_] := Join[{AmbientLight[GrayLevel[.1]]}, Sequence@@MapThread[{SpotLight[#1, {{#2, 0, 8}, {#2, 3, 0}}, {Pi / 2, 20}], {PointLight[#1, {#2, 0, 8}, {0, 8, 0}]}}&, {col, pos}]];Animate[With[{rx = -6Cos[t] + 6, gx = 6Sin[t] + 6, bx = 6Cos[t] + 6}, Show[objs, walls, srcs[{rx, gx, bx}], Lighting -> lights[{rx, gx, bx}], Background -> Black, Boxed -> False, ImageSize -> 300]], {t, 0, 2Pi}, SaveDefinitions -> True, AnimationRunning -> False]Properties & Relations (6)
Surface color and lighting interact with each other:
{Graphics3D[{PointLight[White, {0, 0, 3}], Yellow, Sphere[]}, Lighting -> None],
Graphics3D[{PointLight[Cyan, {0, 0, 3}], White, Sphere[]}, Lighting -> None],
Graphics3D[{PointLight[Cyan, {0, 0, 3}], Yellow, Sphere[]}, Lighting -> None]}Diffuse object and lighting colors can be exchanged and produce the same effect:
{Graphics3D[{PointLight[Red, {0, 0, 3}], White, Sphere[]}, Lighting -> None],
Graphics3D[{PointLight[White, {0, 0, 3}], Red, Sphere[]}, Lighting -> None]}Specular object and lighting colors can be exchanged and produce the same effect:
{Graphics3D[{PointLight[{White, Specularity[Red]}, {0, 0, 3}], White, Specularity[White, 20], Sphere[]}, Lighting -> None],
Graphics3D[{PointLight[{White, Specularity[White]}, {0, 0, 3}], White, Specularity[Red, 20], Sphere[]}, Lighting -> None]}Specularity gives mirror-like reflection:
{Graphics3D[{PointLight[Yellow, {0, 0, 3}], Sphere[]}, Lighting -> None],
Graphics3D[{PointLight[Yellow, {0, 0, 3}], Specularity[White, 40], Sphere[]}, Lighting -> None]}The final color is a linear combination of all the surface colors as well as lighting:
Graphics3D[{PointLight[LightGreen, {0, 0, 3}], Lighter[Red, .5], Glow[Darker[Blue, .8]], Specularity[Yellow, 30], Sphere[]}, Lighting -> None]Point light yields rays toward all the directions from the position:
Graphics3D[{PointLight[White, {1.5, 1.5, 1}], Sphere[], Sphere[{3, 0, 0}], Sphere[{0, 3, 0}], Sphere[{3, 3, 0}]}, Lighting -> None, ViewPoint -> Top]Possible Issues (2)
The default light scheme uses several colored light sources:
Graphics3D[{PointLight[Orange, {1, 1, 1}], Sphere[]}]Set Lighting to None to turn off the default lights:
Graphics3D[{PointLight[Orange, {1, 1, 1}], Sphere[]}, Lighting -> None]Flat surfaces may show little or no reflection:
{Graphics3D[{PointLight[LightRed, {0, 0, 5}], Specularity[White, 50], Cuboid[{-1, -1, -1}, {1, 1, 1}]}, Lighting -> None],
Graphics3D[{PointLight[LightRed, {0, 0, 5}], Specularity[White, 50], Sphere[]}, Lighting -> None]}Neat Examples (1)
p1[θ_] := RotationTransform[θ, {0, 0, 1}][{0, 2, 0}];
p2[θ_] := RotationTransform[θ + Pi / 2, {1, 0, 1}][{0, 2, 0}];
p3[θ_] := RotationTransform[θ + Pi, {1, 0, 0}][{0, 2, 0}];
p4[θ_] := RotationTransform[θ + 3Pi / 2, {1, 0, -1}][{0, 2, 0}];Animate[Graphics3D[{AmbientLight[GrayLevel[.1]], PointLight[Red, p1[θ]], PointLight[Green, p2[θ]], PointLight[Blue, p3[θ]], PointLight[Yellow, p4[θ]], Specularity[White, 30], Sphere[], Sphere[p1[θ], .4], Sphere[p2[θ], .4], Sphere[p3[θ], .4], Sphere[p4[θ], .4]}, Lighting -> None, PlotRange -> 2.5, Background -> Black, Boxed -> False, ImageSize -> 300], {θ, 0, 2Pi}, SaveDefinitions -> True, AnimationRunning -> False]Related Guides
History
Text
Wolfram Research (2021), PointLight, Wolfram Language function, https://reference.wolfram.com/language/ref/PointLight.html.
CMS
Wolfram Language. 2021. "PointLight." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/PointLight.html.
APA
Wolfram Language. (2021). PointLight. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PointLight.html
BibTeX
@misc{reference.wolfram_2026_pointlight, author="Wolfram Research", title="{PointLight}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/PointLight.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_pointlight, organization={Wolfram Research}, title={PointLight}, year={2021}, url={https://reference.wolfram.com/language/ref/PointLight.html}, note=[Accessed: 12-June-2026]}