home *** CD-ROM | disk | FTP | other *** search
- !---------------------------------------------------------------
- !
- ! TUTORIAL6 - RayDance tutorial script #6.
- !
- ! This script demonstrates points, polygons, autopoint polygons,
- ! and polygon holes.
- !
- ! Concepts include :
- !
- ! o Creating a polygon using previously declared points.
- !
- ! o Printing the location of points
- !
- ! o Creating a polygon using autopoint mode.
- !
- ! o Creating a polygon with holes in it.
- !
- ! o Using vector arithmetic to locate a polygon
- !
- ! o A bullseye ground pattern
- !
- !---------------------------------------------------------------
-
- ! Use a print statement to display descriptive text on the
- ! message window.
-
-
- ? "TUTORIAL6 - This script creates a number of polygons some\n",
- "of which have holes.\n\n";
-
- ! Define colors for this scene
-
- RED : COLOR ( RGB, [1,0,0] );
- GREEN : COLOR ( RGB, [0,1,0] );
- CYAN : COLOR ( RGB, [0,1,1] );
- BLUE : COLOR ( RGB, [0,0,1] );
- YELLOW : COLOR ( RGB, [1,1,0] );
-
-
- ! All objects have non-glossy surfaces.
-
- ! ka kd ks n km kr ir kb flags
- MATTE : SURFACE(PHONG, 1, 1, 0, 0, 0, 0, 0, 0, 0 );
-
-
- ! Define where the polygons will go
-
- vector POLYPOS1 = [-550,200,400],
- POLYPOS2 = [0, 100,300],
- POLYPOS3 = [550,250,350];
-
- ! Create some points
-
- POINT p1 = [-200,0,-100] + POLYPOS1,
- p2 = [-300,0,200] + POLYPOS1,
- p3 = [250,0,270] + POLYPOS1,
- p4 = [240,0,-120] + POLYPOS1;
-
-
- ! Create a polygon based on the previously setup points.
-
- POLYGON( p1, p2, p3, p4, RED, MATTE, 0 );
-
-
- ! Create a similar polygon but use auto point creation. The
- ! polygon vertices are vector values preceded by an @ character.
-
- POLYGON( @[-200,0,-100] + POLYPOS2,
- @[-300,0,200] + POLYPOS2,
- @[250,0,270] + POLYPOS2,
- @[240,0,-120] + POLYPOS2,
- GREEN, MATTE, 0 );
-
-
- ! Create another polygon but make some holes in it. There will
- ! be one circular hole and one polygonal hole
-
- HOLE1 : HOLE( CIRCLE, [-20,0,100]+POLYPOS3, 50 );
-
- HOLE2 : HOLE( POLYGON,
- @[-25,0,-18] + POLYPOS3 + [30,0,20],
- @[-35,0,30] + POLYPOS3 + [30,0,20],
- @[29,0,29] + POLYPOS3 + [30,0,20],
- @[28,0,-17] + POLYPOS3 + [30,0,20] );
-
- POLYGON( @[-200,0,-100] + POLYPOS3,
- @[-300,0,200] + POLYPOS3,
- @[250,0,270] + POLYPOS3,
- @[240,0,-120] + POLYPOS3,
- CYAN, MATTE, 0, HOLE1, HOLE2 );
-
-
- ! 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 bullseye pattern
-
- GROUND( BULLSEYE, 0, 200, BLUE, MATTE, YELLOW, MATTE );
-
-
- ! The camera will be positioned along the negative y axis
- ! looking at the second polygon's position
-
- CAMERA'POS = [0,-2500,550];
- CAMERA'TARGET = POLYPOS2;
-
-
- ! The scene has now been constructed, render it!
-
- RENDER;
-
-
- ! All scripts must terminate with an END
-
- END
-