Image Processing Filters > IlvBitmapFilter: The Image Processing Class > The IlvLightSource Class
 
The IlvLightSource Class
The IlvLightSource class lets you model lights. It has three usable subclasses
The IlvDistantLight Class
IlvDistantLight models an infinite light source using an azimuth and an elevation:
Lx = cos(azimuth)*cos(elevation)
Ly = sin(azimuth)*cos(elevation)
Lz = sin(elevation)
The IlvPointLight Class
IlvPointLight models an positional light using three coordinates Lightx, Lighty, and Lightz.
The IlvSpotLight Class
IlvSpotLight models a positional spot light using three coordinates Lightx, Lighty, and Lightz.
Lx = Lightx - x
Ly = Lighty - y
Lz = Lightz - Z(x,y)
L = (Lx, Ly, Lz) / Norm(Lx, Ly, Lz)
where:
Lightx, Lighty, and Lightz
The input light position
Lr, Lg, Lb
The light color vector, is a function of position in the spot light case only:
Lr = Lightr*pow((-L.S),specularExponent)
Lg = Lightg*pow((-L.S),specularExponent)
Lb = Lightb*pow((-L.S),specularExponent)
Given S as the unit vector pointing from the light to the point (pointsAtX, pointsAtY, pointsAtZ) in the x-y plane:
Sx = pointsAtX - Lightx
Sy = pointsAtY - Lighty
Sz = pointsAtZ - Lightz
S = (Sx, Sy, Sz) / Norm(Sx, Sy, Sz)

Version 5.5.1
Copyright © 2012, Rogue Wave Software, Inc. All Rights Reserved.