r = specular(Nx,Ny,Nz,S,V)r = specular(Nx
specularreturns the reflectance
rof a specular surface from the normal vector components. The reflectance is the fraction of light that reflects from the surface toward the viewer.
ris a scalar that varies from 0.0 (no light reflected) to 1.0 (all the light reflected).
specular(Nx,Ny,Nz,S,V) returns the reflectance of the surface with normal vector components
[Nx,Ny,Nz]. The normal vector components can be matrices so that the normal is
These normal components can be calculated using
n(i,j) = [Nx(i,j), Ny(i,j), Nz(i,j)]
surfnorm. The light source vector
S = [Sx,Sy,Sz]is a three-element vector that specifies the direction from the surface to the light source.
Vis three-element vector that specifies the viewpoint. Both can be two-element vectors specifying azimuth and elevation.
r = specular(Nx,Ny,Nz,S,V,spread) specifies the surface spread exponent.
specular is used as part of the function
surfl to produce shaded surfaces.
specularimplements a common approximation for the reflectance of shiny metal-like surfaces. The specular highlight is strongest when the normal vector is in the direction of (s+v)/2, where s is the source direction and v is the view direction.
(c) Copyright 1994 by The MathWorks, Inc.