Setting Model Lighting Properties

You use the following properties to set model lighting:

PropertyDescription
AmbientGets or sets the ambient lighting factor.
DiffuseGets or sets the diffuse lighting factor.
SpecularGets or sets the specular lighting factor.
ColorGets or sets the lighting color.

The following image shows model lighting properties being set in the Details view for the model:

 

Example 1

This code sets model lighting properties:

Model.Ambient = 0.5
Model.Diffuse = 0.3
Model.Specular = 0.2
Model.Color = 13796830

Example 2

When setting model lighting color, you can also use hex color codes, which are three-byte hexadecimal numbers consisting of the prefix 0x followed by six digits. Each byte (or pair of characters) following the prefix represents the intensity of red, green, and blue, respectively. For example, the hex color code for white is 0xFFFFFF.

This code shows how to use a hex color code to specify a lilac shade ( ) for the model lighting color:

Model.Color = 0xD285DE