r = diffuse(Nx,Ny,Nz,S)
diffusereturns the reflectance of a diffuse (Lambertian) surface from the normal vector components. The reflectance is the fraction of light that reflects from the surface toward the viewer. The reflectance varies from 0.0 (no light reflected) to 1.0 (all the light reflected).
r = diffuse(Nx,Ny,Nz,S) returns the reflectance of the surface with normal vector components
[Nx,Ny,Nz]. The normal vector components can be matrices so that for the normal
These normal components can be calculated using
n(i,j) = [Nx(i,j), Ny(i,j), Nz(i,j)]
surfnorm. The light source vector
Sis a three-element vector,
[Sx,Sy,Sz], that specifies the direction from the surface to the light source.
Scan be a two-element vector with azimuth and elevation.
diffuse is used as part of the function
surfl to produce shaded surfaces.
diffuseimplements Lambert's law for diffuse surfaces, r = cos(t), where t is the angle between the surface normal and the light source direction.
(c) Copyright 1994 by The MathWorks, Inc.