THE LIGHT OBJECTS
Default light
Launch the program, and each invocation of the command ini light
light number 1 type simple is automatically created and is defined by:
1) Its number 1
2) Its position = (-750,-500,-1000)
3) Its white color = (1,1,1)
Create a light
Command
light(id) crreates the light
identifier id identical to the light by default.
To change a light just change its attributes.
displ light: displays the light: a disk of light color is displayed in his position, and if it is a spot, its direction is plotted.
ATTRIBUTES OF A LIGHT
Position
Default is a light spot, ie it is supposed to occupy only a point in space referenced by the command:
eye light.
Examples:
1) $eye light(1): prints (-750.0,-500.0,-1000.0).
2) eye light(1)=500,-500,-750: changes the light 1 position.
Color
col light(id): returns the light id color.
col light(id)=r,g,b: changes this color.
Exemples:
1) w=col light(1); gives to w the color of light 1.
2) col light(2)=(col light(1))/2; gives to light 2 half of that of light 1.
Spot
A revolution spot is defined by its type:
type light(id)="aim"
with aiming point: aim light(id)=xa,ya,za
type light(id)="axis"
with direction: axis light(id)=dx,dy,dy
position: eye light(id)=xe,ye,ze.
opening: foc light(id)=f.
a law of variation of the illumination depending on the angle of the radius with the direction
joining his position to his point of view: roll light(id)=r.
an exponential coefficient ext light(id)=c.
Examples:
1) eye light(2)=0,-200;
aim light(2)=0,0,0;
col light(2)=1;
foc light(2)=PI/4;
roll light(2)=10;
Defines a spot situated on the axis y to 200 above the origin, the viewing origin, and forming a cone of light red opening PI / 4, the intensity decreases (cos (a)) ^ 10 of the angle to the angle 0 PI / 4
Defines a spot located on the y axis at 200 below origin, looking to
origine, with a red light cone opening PI/4 whose intensity
decreases as (cos(a))^10 of angle 0 to angle PI/4
2) light(3);
eye light(3)=200;
aim light(3)=-1;
foc light(3)=PI/3;
col light(3)=0,1;
roll light(3)=0;
Defines a spot located on the axis of x is 200 to the right of the origin, looking at the origin, and forming a cone of red light opening PI / 3
the intensity suddenly drops from 1 to 0 for the half angle PI / 3.
Atnuation
coe light(id)=c1,c2,c3 controls the attenuation of the light as a function of its distance from the illuminated point.
ANIMATION OF LIGHTS
Trajectories can be assigned to all the attributes of light for control over time:
Position animation
traj(ni)tran(x1,y1,z1, x21,y2,z2, ...)eye light(id)
animates the light id position over ni images on the polygonal line (x1,y1,z1, x21,y2,z2, ...).
Animation de la couleur
traj(ni)col(r1,v1,b1, r2,v2,b2, ..)light(id)
animates color of light id on ni images on line (r1,v1,b1, r2,v2,b2, ..).
Spot animation
traj(ni)aim(x1,y1,z1, x2,y2,z2, ...)light(id)
animates aim point of light id over ni images on the polygonal line (x1,y1,z1, x21,y2,z2, ...).
traj(ni)tran(x1,y1,z1, x2,y2,z2, ...)axis light(id)
animates the axis of light id over ni images on (x1,y1,z1, x21,y2,z2, ...).
traj(ni)foc(f1,f2, ...)light(id)
animates the foc of light id over ni images on the values (f1,f2, ...).
traj(ni)roll(r1,r2, ...)light(id)
animates the law of light id over ni images on values (r1,r2, ...).
IN DEVELOPMENT
Remarque:
Les volumes éclairés par un spot doivent avoir un lissage de PHONG
(illum vol n=3,...)
Un spot conique de base quelconque est défini par:
1) Une position eye light
2) Un point de visée (commande ´aim light´)
3) Une base (commande ´line light´)
4) Éventuellement une law (see ´roll light´)
5) Une ouverture quelconque du spot peut être définie par:
frame light(num)=n1,n2,...
Mappes de lumières
texture light(n1)=n2,r,v,b,c,dx,dy,dz,an
L´image numéro n2 sera mappée sur une sphère centrée en la position
de la lumière n1 et jouera le rôle d´un verre modifiant la couleur de cette
lumière dans la proportion r,v,b, c est le côté de la fenêtre d´antialliasage
Si (dx,dy,dz,an) est présent, la sphère est tournée de l´angle an
autour de l´axis dx,dy,dz
Une ouverture peut être définie par ´foc light num=f´ (entre .01 et 10)
Ombres portées
Anyflo n´est pas un "lancer de radius" et les ombres portées ne
doivent être employées que pour des bases de données très simples, sinon
utiliser un "ray tracing".
Les volumes faisant des ombres doivent être en illum = 3 (PHONG)
Pour optimiser les calculs on peut:
1) Spécifier les volumes (r1,r2,...) recevant une shadow de la lumière n1
´shadow light n1=r1,r2,...´
2) Spécifier les volumes (p1,p2,...) portant une shadow de la lumière n1
´vol light n1=p1,p2,...´
3) ´ini intersection´ et ´generate intersection vol(p1,p2,...)
ATTACHED LIGHTS
By default, all lights illuminate the entire scene set. But it is possible to attach some lights to certain objects, or objects in certain lights:
Lights attached to objects
attach light vol(idv)=idl
Attaches light idl to volume idv: Volume idv will be illuminated only by the light 1;re idl.
Volumes attached to lights
attach vol light(idl)=idv
Attaches volume idv to the idl: light idl will illuminate only the volume idv.