!---------------------------------------------------------------
!
! TUTORIAL12 - RayDance tutorial script #12.
!
! This script demonstrates landscape creation.
!
! Concepts include :
!
!  o Landscape statement flags.
!
!---------------------------------------------------------------

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


? "TUTORIAL12 - This script creates several landscapes.\n",
  "They are created in two columns.  The column on the left\n",
  "shows landscapes without straight edges.  The column on\n",
  "the right shows landscapes with straight edges.  In both\n",
  "columns the bottom landscape is PHONG smoothed.\n\n";


! Create colors for our objects

GRAY   : color(RGB, [.7,.6,.6] );
GREEN  : color(RGB, [.2,.7,0] );

! Make up a surface for our objects

!                       ka kd ks  n km kr ir kb flgs
MATTE  : surface(PHONG, .5,.8, 0, 0, 0, 0, 0, 0, 0 );


! Declare variables

vector POS;


! Left column of landscapes.  These have 'freeform' edges.  The
! lower landscape is PHONG smoothed.

POS = [-180,0,150];

landscape( 20, 5, 0.25,    ! seed, level, factor
  [-200,-133,0]+POS,
  [0,133,0] + POS,
  [200,-133,0] + POS,
  GREEN, MATTE, 0 );

POS = [-180,0,-150];

landscape( 20, 5, 0.25,    ! seed, level, factor
  [-200,-133,0]+POS,
  [0,133,0] + POS,
  [200,-133,0] + POS,
  GREEN, MATTE, PHONG );


! Right column of landscapes.  These have 'straight' edges.  The
! lower landscape is PHONG smoothed.

POS = [180,0,150];

landscape( 20, 5, 0.45,    ! seed, level, factor
  [-200,133,0]+POS,
  [0,-133,0] + POS,
  [200,133,0] + POS,
  GRAY, MATTE, STRAIGHTEDGES );

POS = [180,0,-150];

landscape( 20, 5, 0.45,    ! seed, level, factor
  [-200,133,0]+POS,
  [0,-133,0] + POS,
  [200,133,0] + POS,
  GRAY, MATTE, PHONG STRAIGHTEDGES );


! Specify the ambient light.

!       always 0's  lamp color   dir.    k1  k2

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


! Specify the STAR light.

!         position        lamp color rad  flags

STAR( [3000,-50000,30000], [1,.9,1], 300, NOSHADOWS );


! Set the background color to a dark purple

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,-1500,600]*0.8;
CAMERA'TARGET = [0,0,0];


! The scene has now been constructed, render it!

RENDER;


! All scripts must terminate with an END

END
