!---------------------------------------------------------------
!
! TUTORIAL5 - RayDance tutorial script #5.
!
! This script demonstrates surfaces that are not perfectly
! smooth mirrors.  This is simulated using the kb (bumpiness)
! coefficient.
!
! Concepts include :
!
!  o Declaring PHONG surfaces with bumpiness for hazy
!    reflections.
!
!  o A gingham pattern ground plane
!
!---------------------------------------------------------------

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


? "TUTORIAL5 - This script defines a scene with one row of\n",
  "spheres floating over a checkerboard.  kb will change\n",
  "from 0.00 to 0.20 moving from left to right.  All spheres\n",
  "are colored orange with a km of 0.7  There is only mirror\n",
  "reflection.  Specular hiliting is turned off.  Making kb\n",
  "non-zero should cause hazy reflections, however, the best\n",
  "results will be obtained with antialiasing enabled.\n\n";

! The camera will be positioned along the negative y axis
! looking at the origin.

CAMERA'POS = [0,-3500,350];
CAMERA'TARGET = [0,0,200];


! Define colors for this scene

ORANGE : COLOR ( RGB, [0.7,0.4,0.2] );
BLUE   : COLOR ( RGB, [0,0,1] );
YELLOW : COLOR ( RGB, [1,1,0] );


! Define surfaces for the spheres, with varying kb.  ks and n
! should also be modified so that specular hilites will also
! become hazier as we move from the left sphere to the right
! sphere.

!                      ka  kd  ks  n   km  kr  ir  kb     flags
SURF1 : SURFACE(PHONG, 0.6,0.3,0.4,100.0,0.7,0.0,0.0,0.00,0 );
SURF2 : SURFACE(PHONG, 0.6,0.3,0.3, 50.0,0.7,0.0,0.0,0.05,0 );
SURF3 : SURFACE(PHONG, 0.6,0.3,0.3, 10.0,0.7,0.0,0.0,0.10,0 );
SURF4 : SURFACE(PHONG, 0.6,0.3,0.2,  5.0,0.7,0.0,0.0,0.15,0 );
SURF5 : SURFACE(PHONG, 0.6,0.3,0.2,  2.0,0.7,0.0,0.0,0.20,0 );

! Define a surface for the ground (gingham pattern)

!                      ka kd ks n  km kr ir kb flags
MATTE : SURFACE(PHONG, 1, 1, 0, 0, 0, 0, 0, 0, 0 );


! Create the row of spheres

SPHERE( [-1000,0,250], 225, ORANGE, SURF1 );
SPHERE( [ -500,0,250], 225, ORANGE, SURF2 );
SPHERE( [    0,0,250], 225, ORANGE, SURF3 );
SPHERE( [  500,0,250], 225, ORANGE, SURF4 );
SPHERE( [ 1000,0,250], 225, ORANGE, SURF5 );


! Specify the ambient light.

AMBIENT( [0,0,0], [0.6,0.6,0.6], [0,0,1], 0, 0 );

! Specify the STAR light.

STAR( [2000,-5000,4000], [1,.9,1], 300 );


! Set the background color to a dark purple

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


! Make the ground plane.  This time we'll use a gingham pattern

GROUND( GINGHAM, 0, 400, BLUE, MATTE, YELLOW, MATTE );


! The scene has now been constructed, render it!

RENDER;


! All scripts must terminate with an END

END
