Specify lighting algorithm
lighting selects the algorithm used to calculate the effects of
light objects on all
patch objects in the current axes. In
order for the
lighting command to have any effects, however, you
must create a lighting object by using the
lighting flat produces
uniform lighting across each of the faces of the object. Select this
method to view faceted objects.
lighting gouraud calculates
the vertex normals and interpolates linearly across the faces. Select
this method to view curved surfaces.
lighting none turns off
lighting(ax,...) uses the axes specified by
instead of the current axes.
Compare Lighting Algorithms
Create a sphere. There is no light by default, which is the same as having a light and setting the algorithm to
sphere axis equal
lightangle function to create a light at an azimuth angle of -45 degrees and an elevation angle of 30 degrees. When you create the light, the default lighting algorithm is
Change the lighting algorithm to
patch functions create graphics objects that are affected by light
lighting command sets the
properties of surfaces and patches appropriately for the graphics object.