12.07.2015 Views

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

MATLAB Function Reference (Volume 2: Graphics)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

surflPurpose2surflSurface plot with colormap-based lightingSyntaxDescriptionsurfl(Z)surfl(X,Y,Z)surfl(...,'light')surfl(...,s)surfl(X,Y,Z,s,k)h = surfl(...)The surfl function displays a shaded surface based on a combination ofambient, diffuse, and specular lighting models.surfl(Z) and surfl(X,Y,Z) create three-dimensional shaded surfaces usingthe default direction for the light source and the default lighting coefficients forthe shading model. X, Y, and Z are vectors or matrices that define the x, y, andz components of a surface.surfl(...,'light') produces a colored, lighted surface using a <strong>MATLAB</strong>light object. This produces results different from the default lighting method,surfl(...,'cdata'), which changes the color data for the surface to be thereflectance of the surface.surfl(...,s) specifies the direction of the light source. s is a two- orthree-element vector that specifies the direction from a surface to a lightsource. s = [sx sy sz] or s = [azimuth elevation]. The default s is 45˚counterclockwise from the current view direction.surfl(X,Y,Z,s,k) specifies the reflectance constant. k is a four-element vectordefining the relative contributions of ambient light, diffuse reflection, specularreflection, and the specular shine coefficient. k = [ka kd ks shine] anddefaults to [.55,.6,.4,10].h = surfl(...) returns a handle to a surface graphics object.RemarksFor smoother color transitions, use colormaps that have linear intensityvariations (e.g., gray, copper, bone, pink).The ordering of points in the X, Y, and Z matrices define the inside and outsideof parametric surfaces. If you want the opposite side of the surface to reflect the2-494

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!