home *** CD-ROM | disk | FTP | other *** search
- // ActiveVRML 1.0 ASCII
- // Saucer3 Sample Script
-
- // The first step is to import the raw media for our sample
- shipred = first (import ("shipred.gif"));
- shipblue = first (import ("shipblue.gif"));
- mountain, extents = import ("mountain.gif");
- clouds = first (import ("clouds.gif"));
- shipnoise = loop (first (import ("ship.wav")));
-
- // The saucer will alternate between two different images
- saucer = shipred until predicate (time > 1) =>
- (shipblue until predicate (time > 1) => saucer);
-
- // Identify the components of the image boundary
- maxx = xComponent (extents);
- maxy = yComponent (extents);
-
- // Make speed a function of the image size
- velocityx = maxx / 5;
- velocityy = velocityx;
-
- // Modify the x and y positions
- xpos = (velocityx * time - maxx) until edgeevent => xpos;
- ypos = sin (time) * velocityy + (maxy / 4);
-
- // Define an event handling moving off the right side of the image
- edgeevent = predicate (xpos > maxx);
-
- // Define a 2D transformation to describe the saucer's position
- movement = translate (xpos, ypos);
-
- // Define a new saucer object that has movement applied to it
- activesaucer = transformImage (movement, saucer);
-
- // Add some effects to our sound
- soundgain = ypos / maxy + 0.2;
- soundeffect = gain (soundgain, rate (2, shipnoise));
-
- // Define the expression used for display output
- model = mountain over activesaucer over clouds, soundeffect;
-
-
-