This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Selecting a Lighting Method

Face and Edge Lighting Methods

When you add lights to an axes, MATLAB® rendering software determines the effects these lights have on the patch and surface objects that are displayed in that axes. There are different methods used to calculate the face and edge coloring of lit objects, and the one you select depends on the results you want to obtain.

MATLAB supports two different algorithms for lighting calculations, selected by setting the FaceLighting and EdgeLighting properties of each patch and surface object in the scene.

  • Flat lighting — Produces uniform color across each of the faces of the object. Select this method to view faceted objects.

  • Gouraud lighting — Calculates the colors at the vertices and then interpolates colors across the faces. Select this method to view curved surfaces.

This illustration shows how a red sphere looks using each of the lighting methods with one white light source.

The lighting command (as opposed to the light function) provides a convenient way to set the lighting method.

Was this topic helpful?