Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.0.0 - Français


light

creates a light object in the given axes

Syntax

light()
light(<LightProperty>)
light(axes_handle, <LightProperty>)
h = light(...)

Arguments

axes_handle

The handle of the axes, if omitted is used the current axes.

<LightProperty>

Optional argument specifying the light properties. The optional arguments are set using syntax: "light(propname1=propvalue1, propname2=propvalue2, ..., propnameN=propvalueN)".

Following there is the list of optional arguments:

visible:

This field defines if the light is enabled "on" or disabled "off".

type:

This field defines the type of light used. There are two types available:"directional" and "point". Directional lights are positioned infinitely far from the surface thus emitting parallel rays.

Point lights are defined as a point in space thus emitting rays in all directions. The default value is "point".

direction:

This field defines the ray direction for directional light. The direction can be changed using a 3 element vector "[x, y, z]" representing a vector starting from the origin.

The default value is "[0 0 1]".

position:

This field defines the light position for point light. The position can be changed using a 3 element vector "[x, y, z]".

The default value is "[0 0 1]".

ambient_color:

This field defines the ambient color of the light. The color is defined by a 3 element vector "[red, green, blue]" with each element in the range [0, 1].

The default value is "[0.1 0.1 0.1]".

diffuse_color:

This field defines the diffuse color of the light. The color is defined by a 3 element vector "[red, green, blue]" with each element in the range [0, 1].

The default value is "[1 1 1]".

specular_color:

This field defines the specular color of the light. The color is defined by a 3 element vector "[red, green, blue]" with each element in the range [0, 1].

The default value is "[1 1 1]".

h

This optional output contains a handle to a Light entity. For a list of properties, see light_properties.

Description

The light function, creates a light entity (see light_property for the light entity properties) in the specified axes and sets the properties specified with <LightProperty> optional arguments.

For a more detailed explanation about how lighting affects the surface appearance see lighting.

Examples

plot3d()
light(visible="on", type="point", position=[0 0 1])

See also

Report an issue
<< Éclairage Éclairage light properties >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 24 11:15:59 CEST 2024