Skip to content

surfl

plot · scripts/plot/draw/surfl.m

: h = surfl (z)
: h = surfl (x, y, z)
: h = surfl (…, lightdir)
: h = surfl (…, lightdir, refl)
: h = surfl (…, "light")
: h = surfl (ax, …)

Draw a shaded surface with a simulated light source.

The surface data are given as for surf. The light direction lightdir is either [azimuth elevation] in degrees or a vector [lx ly lz]; by default the light comes from 45 degrees counterclockwise of the current viewing azimuth. The reflectance vector refl is [ambient diffuse specular shininess] with the default [0.55 0.6 0.4 10]. The colour data of the surface are replaced by the computed intensity in the range 0 to 1, so a gray colormap gives the best result. With the option "light" a light object is added to the axes.

The surface handle is returned.