Home > freetb4matlab > plot > surfl.m

# surfl

## PURPOSE

% Plot a lighted surface given matrices @var{x}, and @var{y} from @code{meshgrid} and

## SYNOPSIS

function retval = surfl (varargin)

## DESCRIPTION

```% -*- texinfo -*-
% @deftypefn {Function File} {} surfl (@var{x}, @var{y}, @var{z})
% @deftypefnx {Function File} {} surfl (@var{z})
% @deftypefnx {Function File} {} surfl (@var{x}, @var{y}, @var{z}, @var{L})
% @deftypefnx {Function File} {} surfl (@var{x}, @var{y}, @var{z}, @var{L}, @var{P})
% @deftypefnx {Function File} {} surfl (@dots{},'light')
% Plot a lighted surface given matrices @var{x}, and @var{y} from @code{meshgrid} and
% a matrix @var{z} corresponding to the @var{x} and @var{y} coordinates of
% the mesh.  If @var{x} and @var{y} are vectors, then a typical vertex
% is (@var{x}(j), @var{y}(i), @var{z}(i,j)).  Thus, columns of @var{z}
% correspond to different @var{x} values and rows of @var{z} correspond
% to different @var{y} values.
%
% The light direction can be specified using @var{L}.  It can be
% given as 2-element vector [azimuth, elevation] in degrees or as 3-element vector [lx, ly, lz].
% The default value is rotated 45° counter-clockwise from the current view.
%
% The material properties of the surface can specified using a 4-element vector
% @var{P} = [@var{AM} @var{D} @var{SP} @var{exp}] which defaults to
% @var{p} = [0.55 0.6 0.4 10].
% @table @code
% @item 'AM' strength of ambient light
% @item 'D' strength of diffuse reflection
% @item 'SP' strength of specular reflection
% @item 'EXP' specular exponent
% @end table
%
% The default lighting mode 'cdata', changes the cdata property to give the impression
% of a lighted surface.  Please note: the alternative 'light' mode, which creates a light
% object to illuminate the surface is not implemented (yet).
%
% Example:
%
% @example
% @group
% colormap(bone);
% surfl(peaks);
% @end group
% @end example
% @seealso{surf, diffuse, specular, surface}
% @end deftypefn```

## CROSS-REFERENCE INFORMATION

This function calls:
• axes % Create an axes object and return a handle to it.
• axis % Set axis limits for plots.
• diffuse % Calculate diffuse reflection strength of a surface defined by the normal
• gca % Return a handle to the current axis object. If no axis object
• ishold % Return true if the next line will be added to the current plot, or
• newplot % Prepare graphics engine to produce a new plot. This function should
• specular % Calculate specular reflection strength of a surface defined by the normal
• surface % Plot a surface graphic object given matrices @var{x}, and @var{y} from
• view % Set or get the viewpoint for the current axes.
This function is called by:

Generated on Sat 16-May-2009 00:04:49 by m2html © 2003