3-D Visualization |
|
Properties That Affect Lighting
You cannot see light objects themselves, but you can see their effects on any patch and surface objects present in the axes containing the light. A number of functions create these objects, including surf
, mesh
, pcolor
, fill
, and fill3
as well as the surface
and patch
functions.
You control lighting effects by setting various axes, light, patch, and surface object properties. All properties have default values that generally produce desirable results. However, you can achieve the specific effect you want by adjusting the values of these properties.
Property
|
Effect
|
AmbientLightColor
|
An axes property that specifies the color of the background light in the scene, which has no direction and affects all objects uniformly. Ambient light effects occur only when there is a visible light object in the axes.
|
AmbientStrength
|
A patch and surface property that determines the intensity of the ambient component of the light reflected from the object.
|
DiffuseStrength
|
A patch and surface property that determines the intensity of the diffuse component of the light reflected from the object.
|
SpecularStrength
|
A patch and surface property that determines the intensity of the specular component of the light reflected from the object.
|
SpecularExponent
|
A patch and surface property that determines the size of the specular highlight.
|
SpecularColorReflectance
|
A patch and surface property that determines the degree to which the specularly reflected light is colored by the object color or the light source color.
|
FaceLighting
|
A patch and surface property that determines the method used to calculate the effect of the light on the faces of the object. Choices are either no lighting, or flat, Gouraud, or Phong lighting algorithms.
|
EdgeLighting
|
A patch and surface property that determines the method used to calculate the effect of the light on the edges of the object. Choices are either no lighting, or flat, Gouraud, or Phong lighting algorithms.
|
BackFaceLighting
|
A patch and surface property that determines how faces are lit when their vertex normals point away from the camera. This property is useful for discriminating between the internal and external surfaces of an object.
|
FaceColor
|
A patch and surface property that specifies the color of the object faces.
|
EdgeColor
|
A patch and surface property that specifies the color of the object edges.
|
VertexNormals
|
A patch and surface property that contains normal vectors for each vertex of the object. MATLAB uses vertex normal vectors to perform lighting calculations. While MATLAB automatically generates this data, you can also specify your own vertex normals.
|
NormalMode
|
A patch and surface property that determines whether MATLAB recalculates vertex normals if you change object data (auto ) or uses the current values of the VertexNormals property (manual ). If you specify values for VertexNormals , MATLAB sets this property to manual .
|
See a description of all axes, surface, and patch object properties.
| Adding Lights to a Scene | | Selecting a Lighting Method | |
© 1994-2005 The MathWorks, Inc.