Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Graphics > lighting > light

light

creates a light object in the given axes

Syntax

l=light()
l=light(<LightProperty>)
l=light(axes_handle, <LightProperty>)

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]".

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();
l = light(visible="on", type="point", position=[0 0 1]);

See also

Report an issue
<< lighting lighting 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:
Tue Feb 25 08:49:21 CET 2020