home *** CD-ROM | disk | FTP | other *** search
- !---------------------------------------------------------------
- !
- ! TUTORIAL20 - RayDance tutorial script #20.
- !
- ! This script demonstrates color gradients.
- !
- ! Concepts include :
- !
- ! o Gradient color
- !
- ! o SKY background
- !
- !---------------------------------------------------------------
-
- ! Use a print statement to display descriptive text on the
- ! message window.
-
-
- ? "TUTORIAL20 - This script creates three extruded columns\n",
- "and applies color gradients to them. All gradients have\n",
- "three cycles, and the same color and position end points.\n",
- "The column on the left uses a RGB gradient. The others\n",
- "use HSV gradients. The column on the right uses the\n",
- "mirror flag. The background is another gradient produced\n",
- "by a SKY background.\n";
-
-
- ! Create a surface for our flags...
-
- ! ka kd ks n km kr ir kb flgs
- MATTE : surface(PHONG, .5,.8,.4,30, 0, 0, 0, 0, 0 );
-
-
- ! Create three gradient colors. All use the same position
- ! and color endpoints. Colors range from RED to BLUE. The
- ! first uses a RGB spread. The others use HSV spreading. The
- ! last mirror images the color repeats. All use three cycles
- ! of gradient spread.
-
- ! name : gradient( pos0, pos1, color0, color1, cycles, flags );
-
-
- GRAD1_MAP : GRADIENT( [0,0,-300], [0,0,300], [1,0,0], [0,0,1],
- 3, RGB REPEAT );
-
- GRAD2_MAP : GRADIENT( [0,0,-300], [0,0,300], [1,0,0], [0,0,1],
- 3, HSV REPEAT );
-
- GRAD3_MAP : GRADIENT( [0,0,-300], [0,0,300], [1,0,0], [0,0,1],
- 3, HSV REPEAT MIRROR );
-
-
- extrude( ( [-50,-50,0], [-50,50,0], [50,50,0], [50,-50,0] ),
- 600, [0,0,600], [1,1,1], [-300,0,-300], [0,0,0],
- GRAD1_MAP, MATTE, 0 );
-
- extrude( ( [-50,-50,0], [-50,50,0], [50,50,0], [50,-50,0] ),
- 600, [0,0,600], [1,1,1], [0,0,-300], [0,0,0],
- GRAD2_MAP, MATTE, 0 );
-
- extrude( ( [-50,-50,0], [-50,50,0], [50,50,0], [50,-50,0] ),
- 600, [0,0,600], [1,1,1], [300,0,-300], [0,0,0],
- GRAD3_MAP, MATTE, 0 );
-
-
- ! 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 );
-
-
- ! A SKY background allows for a gradient color background.
- ! Three colors are specified, horizon, zenith, and nadir, which
- ! are the interpolated. The rate of interpolation is controlled
- ! by the gradient factor. Values smaller than 1 will tend to
- ! change colors fastest near the horizon. Values greater than
- ! one will tend to change faster near the zenith and nadir.
- ! Interpolation of a SKY background is always done in RGB mode.
-
- ! horizon zenith nadir factor
- !
- BACKGROUND( SKY, [.7,.7,.7], [.2,.4,.6], [.6,.2,.1], .6 );
-
-
- ! The camera will be positioned along the negative y axis aiming
- ! toward the central objects
-
- CAMERA'POS = [0,-1500,0];
- CAMERA'TARGET = [0,0,0];
-
-
- ! The scene has now been constructed, render it!
-
- RENDER;
-
-
- ! All scripts must terminate with an END
-
- END
-