!---------------------------------------------------------------
!
! TUTORIAL7 - RayDance tutorial script #7.
!
! This script demonstrates LAMP1, LAMP2, and STAR lighting.
!
! Concepts include :
!
!  o Illumination characteristics of STAR, LAMP1, and LAMP2
!    lights.
!
!  o Use of the INVISIBLE flag for lights.
!
!---------------------------------------------------------------

! Use a print statement to display descriptive text on the
! message window.


? "TUTORIAL7 - This script creates three rows of lights.\n",
  "The top row are STARS, the middle row are LAMP2s, and \n",
  "the bottom row are LAMP1s.  The LAMP2 and STAR lights are\n",
  "placed at different heights.  The LAMP1 lights have\n",
  "varying K values.  Each type of light has a different\n",
  "illumination fall off (the rate at which illumination\n",
  "from the light becomes dimmer with distance).  STARS\n",
  "have no fall off with distance.  LAMP2 lights fall off as\n",
  "the square of the distance between the light and the\n",
  "object being illuminated.  LAMP1 lights fall off linearly\n",
  "as distance times the parameter K.  In general, LAMP2\n",
  "lights will fall off the most rapidly.  The exception\n",
  "to this are LAMP1 lights where K is very large.\n\n";

! Create colors for our ground plane

BLUE   : color( RGB, [0,0,1] );
PURPLE : color( RGB, [.7,0,1] );


! Create a surface for our ground plane

MATTE  : surface(PHONG, 0.5,.8, 0,0, 0,0,0, 0, 0 );


! We'll use a piece of ground as our illumination target

ground( GINGHAM, 0, 400, BLUE, MATTE, PURPLE, MATTE );


! NOTE:  Color values for LAMP1 and especially LAMP2 lights can
! be quite large!  Check out the differences in color values
! for the lights declared below.


! A set of LAMP1 lights

vector LAMP1_COLOR = [2000,2000,2000];

!             position      rgb color   rad K   flags

LAMP1( [ 3200,-3200, 100], LAMP1_COLOR, 20, 1, INVISIBLE );
LAMP1( [ 1064,-3200, 100], LAMP1_COLOR, 20, 2, INVISIBLE );
LAMP1( [-1064,-3200, 100], LAMP1_COLOR, 20, 4, INVISIBLE );
LAMP1( [-3200,-3200, 100], LAMP1_COLOR, 20, 8, INVISIBLE );


! A set of LAMP2 lights

vector LAMP2_COLOR = [80000,80000,80000];

!             position   rgb color   rad   flags
 
LAMP2( [ 3200, 0,  40], LAMP2_COLOR, 20, INVISIBLE );
LAMP2( [ 1064, 0,  60], LAMP2_COLOR, 20, INVISIBLE );
LAMP2( [-1064, 0,  80], LAMP2_COLOR, 20, INVISIBLE );
LAMP2( [-3200, 0, 100], LAMP2_COLOR, 20, INVISIBLE );


! A set of LAMP3 lights

vector STAR_COLOR = [.4,.4,.4];

!             position    rgb color   rad  flags

STAR( [ 3200, 3200, 400], STAR_COLOR, 20, INVISIBLE );
STAR( [ 1064, 3200, 300], STAR_COLOR, 20, INVISIBLE );
STAR( [-1064, 3200, 200], STAR_COLOR, 20, INVISIBLE );
STAR( [-3200, 3200, 100], STAR_COLOR, 20, INVISIBLE );


! Set the background color to a dark purple

!            type  rgb color value

BACKGROUND( PLAIN, [0,0.05,0.15] );


! The camera will be positioned along the negative y axis aiming
! toward the central objects

CAMERA'POS = [0,-500,16000];
CAMERA'TARGET = [0,0,0];


! The scene has now been constructed, render it!

RENDER;


! All scripts must terminate with an END

END
