home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-03-27 | 4.0 KB | 170 lines | [TEXT/PvRy] |
- // Persistence of Vision 2 scene file
- // ------------------------------------------------------------
- // File: MooVerDemo.POV
- // Desc:
- // This file creates a simple animation sequence of
- // PICT images via POV-Ray. These images can then
- // be dropped onto MooVer to create a QuickTime movie.
- // Author: Eduard [esp] Schwan
- // ------------------------------------------------------------
- //
-
-
- /*
- ---------------------------------------------------------------
- Grab a bunch of useful color definitions. This will
- also insure you have your INCLUDE folder path set up
- properly in the Application Preferences dialog.
- */
-
- #include "colors.inc"
-
-
- /*
- ---------------------------------------------------------------
- Indirectly declaring a clock variable might seem odd at first,
- why not just sprinkle "clock" expressions all over the scene file?
- Because, you can easily substitute a single value in the following
- declare statement in place of clock, and you can then immediately
- render any single frame you wish. It just adds a single point of
- entry for the animation stuff. I also usually assume that the
- clock value always goes from 0.0 to 1.0, and then create my
- expressions down in the code where appropriate to rescale the range.
- */
-
- #declare Animate_Value = clock // 0.0 to 1.0
-
- #declare Torus_Rot = 180 // total degrees to rotate whole object
- #declare Ball_Rot = 180 // total degrees to rotate each ball
-
- // ---- camera ----
-
- camera
- {
- direction 2*z
- location <0, 1.5, -4>
- // right 4/3*x // use this if scene is not square (MxN instead of MxM)
- look_at 0*y
- }
-
- // ---- sun ----
-
- light_source
- {
- 0*x color White
- looks_like { box {<-1,-2,-1> <1,2,1> pigment{color Yellow}} }
- translate <20,10,-10>
- }
-
- // ---- sky ----
-
- // use the following for a busy and interesting sky...
- sphere
- {
- 0*x, 1.0
- texture
- {
- pigment
- {
- marble rotate 90*z // almost like a Y gradient, not quite :-)
- turbulence <1,0.5,0.5>
- scale 0.5
- color_map
- {
- [0.1 color blue 0.2]
- [0.5 color blue 0.8]
- [0.6 color blue 1 red 0.5]
- [0.7 color red 0.5 green 0.5 blue 0.5]
- [1.0 color White]
- }
- } // -pigment
- finish { ambient 1 diffuse 0 }
- } // -texture
- scale 50
- }
-
-
- // ---- object ----
-
- // the agate marbles
- #declare SphereTexture = texture
- {
- pigment { agate scale 0.3 }
- finish { reflection 0.1 specular 0.3 }
- }
-
- // wooden torus dimensions
- #declare MajorRad = 0.7
- #declare MinorRad = 0.3
-
- union
- {
- intersection // #1
- {
-
- // wooden torus
- torus
- {
- MajorRad, MinorRad
- scale <1,0.5,1> // squish it a little flat
- texture
- {
- pigment{wood translate 4*x turbulence 0.2 scale 0.15}
- finish{specular 0.4 roughness 0.05}
- }
- } // -torus
-
- // cut out slits for balls to fit in
- box
- {
- -(x+y+z), x+y+z
- scale <MinorRad,1.1,1.1>
- inverse
- } // -box
- } // -intersection #1
-
- // plug up the holes with a couple of spheres
- // Each ball is rotating slowly in place as it is orbiting.
- // By the time of a 1/2 orbit, the 2nd ball will have rotated
- // its texture over to match the 1st balls original texture
- // position, making a looped movie smoother looking.
- // Hopefully nobody will notice the woodgrain shift.
- sphere
- { 0*x, MinorRad
- texture {SphereTexture} rotate Animate_Value*Ball_Rot*x translate -MajorRad*z
- }
- sphere
- { 0*x, MinorRad
- texture {SphereTexture} rotate -Animate_Value*Ball_Rot*x translate +MajorRad*z
- }
-
- // fill the hole with an apple core
- intersection // #2
- {
- // the hole/inside of a torus (inversed)
- torus
- {
- 1.3, 1.1
- inverse
- texture
- {
- pigment { color green 1 }
- normal { bumps 0.3 scale 0.1 }
- finish { reflection 0.5 specular 0.3 metallic }
- }
- } // -torus
- // clipped by a sphere
- sphere
- {
- 0*x, 0.9 // SphereRad < TorusMajorRad!
- pigment { color red 1 }
- }
- } // -intersection #2
-
- // Here's the main magic...
- // rotate this whole toroid ensemble around the Y axis
- rotate Animate_Value*Torus_Rot*y
-
- } // -union
-
-