!---------------------------------------------------------------
!
! RING.art - Create a box section ring...
!
! This script demonstrates the lathe statement.
!
! Concepts include :
!
!  o Creating a simple outline and using it in a lathe statement
!
!  o Importing an outline
!
!  o Altering lathe parameters
!
!---------------------------------------------------------------


! Variables

integer  SEGMENTS = 32;     ! # of steps around lathed objects
vector   SCALING = [1,1,1]; ! Full size


integer  k;


! Create colors for our objects

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


! Create a surface for our objects

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

map1 : texturemap( "lighthouse.ilbm" );


! Create a simple outline (for rotation around the z axis)
! and lathe it.  Negative lathe angles create a counter-
! clockwise lathing action (rather than a clockwise one).

OUTLINE1 : outline[4] = (
  [100,0,100], [100,0,-100], [-100,0,-100], [-100,0,100]
);
OUTLINE1 = OUTLINE1 + [500,0,0];

lathe( ( OUTLINE1 ),
  SEGMENTS, -260, 0, SCALING, [0,0,0], [-40,0,0],
  map1(1,1,smooth3), MATTE, ZAXIS|OPEN|CONTINUOUS|NOENDS );


! Specify the ambient light.

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

! Specify the STAR light.

STAR( [40000,-50000,60000], [1,.9,1], 300 );


! 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 = [800,-2900,200];
CAMERA'TARGET = [0,40,50];


! The scene has now been constructed, render it!

RENDER;


! All scripts must terminate with an END

END
