DirectionalLight
DirectionalLight[col,pt]
is a three–dimensional graphics directive that specifies the directional light of color col from the point pt to the center of the bounding box to use in coloring 3D surfaces.
DirectionalLight[col,{pt1,pt2}]
uses a directional light along the vector from pt1 to pt2.
Details
- DirectionalLight is also known as free directional light.
- DirectionalLight is typically used to create brighter highlights and darker shadows on objects by casting light rays equally from a given direction.
- DirectionalLight[col,{pt1,pt2}] yields parallel simulated light rays of color col in the direction vector defined by {pt1,pt2}.
- Colors of light sources col can be defined by RGBColor, Hue or any other color specification.
- The setting for DirectionalLight affects only colors associated with diffuse and specular reflection on a 3D surface.
- Light sources with color specifications col 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 and aiming points pti 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.
Examples
open allclose allBasic Examples (3)
Scope (5)
Lighting Specification (4)
Lighting Positions (1)
Specify the light position in the view coordinate system using ImageScaled:
The light source position is always fixed relative to the view point:
Generalizations & Extensions (8)
The colored lighting is equivalent to the following explicit setting:
The accent lighting is equivalent to the following explicit setting:
The neutral lighting is equivalent to the following explicit setting:
Predefined three-point lighting:
The three-point lighting is equivalent to the following explicit setting:
Specify lighting for each object:
Specify lighting within the graphics:
If not specified, the target direction is given toward the center of the objects:
Specify diffuse and specular colors separately for both objects and lights:
Applications (3)
Text
Wolfram Research (2021), DirectionalLight, Wolfram Language function, https://reference.wolfram.com/language/ref/DirectionalLight.html.
CMS
Wolfram Language. 2021. "DirectionalLight." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/DirectionalLight.html.
APA
Wolfram Language. (2021). DirectionalLight. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/DirectionalLight.html