This functionality does not run in MATLAB.
plot::AmbientLight(<intensity>, <a = amin .. amax>, options)
plot::AmbientLight(intensity) generates undirected ambient light of the given intensity.
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 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.
While directed lights such as plot::DistantLight etc. create shading effects that add depth to the picture, a certain amount of undirected ambient light is usually needed.
plot::AmbientLight(intensity) creates ambient light whose intensity is given by the parameter intensity. When the intensity is 1, the ambient light dominates all other light sources.
By default, white light is created. Other colours can be chosen by the attribute LightColor.
It does not make sense to have more than one ambient light object in a scene.
|Frames||the number of frames in an animation||50|
|LightColor||the color of light||RGB::White|
|LightIntensity||intensity of light||1.0|
|Name||the name of a plot object (for browser and legend)|
|ParameterEnd||end value of the animation parameter|
|ParameterName||name of the animation parameter|
|ParameterBegin||initial value of the animation parameter|
|ParameterRange||range of the animation parameter|
|TimeEnd||end time of the animation||10.0|
|TimeBegin||start time of the animation||0.0|
|TimeRange||the real time span of an animation||0.0 .. 10.0|
We create a 3D function graph in flat white and use ambient white light to illuminate it:
f := plot::Function3d(sin(x + y) + cos(x - y), x = -PI..PI, y = -PI..PI, FillColorType = Flat, Color = RGB::White): ambientlight := plot::AmbientLight(0.7): plot(f, ambientlight):
We create another ambient light with animated intensity:
ambientlight := plot::AmbientLight(a, a = 0..1): plot(f, ambientlight)
We add directed yellow light to the scene and study the mixture between the "sunlight" and an increasing amount of ambient light. When the ambient light is at full intensity, it dominates the directed light completely:
sunlight := plot::DistantLight([0, 0, 0], [5, 1, -3], 1, LightColor = RGB::Yellow): plot(f, ambientlight, sunlight)
delete f, ambientlight, sunlight:
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.