Main Content

simscape.multibody.AdvancedVisualProperties Class

Namespace: simscape.multibody
Superclasses: simscape.multibody.VisualProperties

Specify advanced visual properties

Since R2022a

Description

Use an object of the simscape.multibody.AdvancedVisualProperties class to specify advanced visual properties, including shininess and ambient, diffuse, emissive, and specular light on the rendered object. You can specify each of the four color properties by using a 1-by-3 or 3-by-1 vector that specifies the red, green, and blue color components. You can also add an optional fourth element to the RGB vector to specify the opacity of each color.

Each element of the RGB vector of the AmbientColor, DiffuseColor, and SpecularColor properties specifies the reflectivity of the corresponding color component. For example, the first element of the SpecularColor property gives the proportion of red light in the specular reflection on the rendered object surface. The EmissiveColor property specifies the color of the light emitted by the rendered object itself.

The Shininess property specifies the size and sharpness of a specular highlight. A rendered object with a small value for the Shininess property has duller surface and produces a big and fuzzy specular highlight. In contrast, an object with a large value for the Shininess property has a shiny surface that produces a small and sharp specular highlight.

Class Attributes

Sealed
true
ConstructOnLoad
true
RestrictsSubclassing
true

For information on class attributes, see Class Attributes.

Creation

Description

avis = simscape.multibody.AdvancedVisualProperties creates an advanced visual properties object with default values.

Properties

expand all

Color of the ambient light, specified as an [R,G,B] or [R,G,B,A] vector with values in the range of 0 to 1. The vector can be a row or column vector. The optional fourth element specifies the color opacity. Omitting the opacity element is equivalent to specifying a value of 1.

This property specifies a general level of illumination that does not come directly from a light source. To change the shadow color of the rendered object, use the AmbientColor property.

Example: [0.5 0.5 0.5]

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: double

Color of the light due to diffuse reflection, specified as an [R,G,B] or [R,G,B,A] vector with values in the range of 0 to 1. The vector can be a row or column vector. The optional fourth element specifies the color opacity. Omitting the opacity element is equivalent to specifying a value of 1.

The diffuse color reflects the main color of the rendered object and provides shading that gives the rendered object a three-dimensional appearance.

Example: [0 1 0 1]

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: double

Color due to self illumination, specified as an [R,G,B] or [R,G,B,A] vector with values in the range of 0 to 1. The vector can be a row or column vector. The optional fourth element specifies the color opacity. Omitting the opacity element is equivalent to specifying a value of 1.

Example: [0 0 1 1]

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: double

Shininess of the rendered object, specified as a scalar in the range of 0 to 128. This property affects the sharpness of the specular reflections of the rendered object. An object with high shininess has a mirror-like appearance, and an object with low shininess has a more low-gloss or satin appearance.

Example: 90

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: double

Color of the light due to specular reflection, specified as an [R,G,B] or [R,G,B,A] vector with values in the range of 0 to 1. The vector can be a row or column vector. The optional fourth element specifies the color opacity. Omitting the opacity element is equivalent to specifying a value of 1.

To change the color of the specular highlight, which is the bright spot on the rendered object due to the reflection of the light from the light source, use the SpecularColor property.

Example: [1 0 0 1]

Attributes:

GetAccess
public
SetAccess
public
NonCopyable
true

Data Types: double

Version History

Introduced in R2022a