!---------------------------------------------------------------
!
! TUTORIAL11 - RayDance tutorial script #11.
!
! This script demonstrates landscape creation.
!
! Concepts include :
!
!  o Using the landscape statement.
!
!  o Procedure calling
!
!---------------------------------------------------------------

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


? "TUTORIAL11 - This script creates several landscapes.\n",
  "They are created in two columns.  The column on the left\n",
  "demonstrates the effect of increasing the LEVEL parameter\n",
  "with level increasing from top to bottom.  The righthand\n",
  "column shows the effect of increasing the FACTOR\n",
  "parameter with factor increasing from top to bottom.  All\n",
  "the landscapes here use the same seed value.\n";


! Create colors for our objects

GRAY   : color(RGB, [0,0,.7] );
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 );


! A procedure is used to create the landscape panels.  This is
! done to make the process of corner location simpler.

proc LAND_HO( vector POS, real FACTOR, integer LEVEL )

  landscape( 20, LEVEL, FACTOR,
    [-200,-133,0]+POS,
    [0,133,0] + POS,
    [200,-133,0] + POS,
    GREEN, MATTE, 0 );

endproc


! Four landscape panels of differing level (complexity increases
! from left to right) but constant factor (bumpiness doesn't
! change

LAND_HO( [-250,0, 270], 0.25, 1 );
LAND_HO( [-250,0,  90], 0.25, 2 );
LAND_HO( [-250,0, -90], 0.25, 3 );
LAND_HO( [-250,0,-275], 0.25, 4 );


! Four landscape panels of differing level (complexity increases
! from left to right) but constant factor (bumpiness doesn't
! change

LAND_HO( [ 250,0, 270], 0.0, 4 );
LAND_HO( [ 250,0,  90], 0.1, 4 );
LAND_HO( [ 250,0, -90], 0.2, 4 );
LAND_HO( [ 250,0,-270], 0.3, 4 );



! Specify the ambient light.

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


! Specify the STAR light.

STAR( [3000,-50000,10000], [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];
CAMERA'TARGET = [0,0,0];


! The scene has now been constructed, render it!

RENDER;


! All scripts must terminate with an END

END
