diffuse

Purpose

Reflectance of a diffuse surface (Lambert's Law).

Synopsis

r = diffuse(Nx,Ny,Nz,S)

Description

diffuse returns 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 n,

n(i,j) = [Nx(i,j), Ny(i,j), Nz(i,j)]
These normal components can be calculated using surfnorm. The light source vector S is a three-element vector, [Sx,Sy,Sz], that specifies the direction from the surface to the light source. S can be a two-element vector with azimuth and elevation.

diffuse is used as part of the function surfl to produce shaded surfaces.

Algorithm

diffuse implements Lambert's law for diffuse surfaces, r = cos(t), where t is the angle between the surface normal and the light source direction.

See Also

specular, surfl, surfnorm

(c) Copyright 1994 by The MathWorks, Inc.