home *** CD-ROM | disk | FTP | other *** search
- //
- // Animation of mirrored blobs & glass balls rotating around. Recommend
- // tracing this at as high a resolution as you have disc space for. At
- // the default image size of 320x240, 200 frames, 16 bpp and DTA to crunch
- // the frames, you will get a FLI of around 3.9 Meg.
- //
- // Polyray data file: Alexander Enzmann
- //
- // Define the range of the animation, for smoother results use a higher
- // value of "end_frame". For coarser animations make it smaller.
- //
- start_frame 0
- end_frame 200
- total_frames 201
- outfile mirb
-
- // Build the interpolation variable
- define t0 0
- define t1 total_frames
- define increment frame / (t1 - t0)
-
- // Set up the camera
- viewpoint {
- from rotate(<0, 10, -20>, <0, 1, 0>, 35)
- at <0,0,0>
- up <0,1,0>
- angle 45
- resolution 480, 360
- aspect 4/3
- }
-
- // Set up background color & lights
- background 0.7 * orange
- light 0.8 * white, <-30,30,-50>
- light 0.8 * white, < 10,20,-50>
-
- define glass
- texture {
- surface {
- ambient 0
- diffuse 0
- specular 0.1
- reflection white, 0.1
- microfacet Cook 5
- transmission white, 0.8, 1.5
- }
- }
-
- define mirror
- texture {
- surface {
- ambient white, 0.05
- diffuse white, 0.05
- specular 0.1
- microfacet Cook 5
- reflection white, 0.8
- }
- }
-
- // The blob components move at two rates of speed. By basing the speed of
- // rotation on the number of degrees in a circle and the number of times it
- // will go around the circle, we can make the blob component whirl around.
- //
- // The value of "increment" varies from 0 to 1 over the course of the animation,
- // so the result of the two definitions below makes angles that go either
- // twice or three times around a circle during the course of the animation.
- define speed1 2 * increment * 360
- define speed2 3 * increment * 360
-
- //
- // The blob components are located on the points of equilateral triangles.
- // There is a triangle lying in each of the three standard planes (xy, xz, yz).
- //
- define loc01 rotate(< 6, 0, 0>, <0, 0, 1>, speed1)
- define loc02 rotate(< 6, 0, 0>, <0, 0, 1>, speed2)
- define loc03 rotate(< 6, 0, 0>, <0, 0, 1>, 120 + speed1)
- define loc04 rotate(< 6, 0, 0>, <0, 0, 1>, 120 + speed2)
- define loc05 rotate(< 6, 0, 0>, <0, 0, 1>, 240 + speed1)
- define loc06 rotate(< 6, 0, 0>, <0, 0, 1>, 240 + speed2)
- define loc07 rotate(< 0, 6, 0>, <1, 0, 0>, speed1)
- define loc08 rotate(< 0, 6, 0>, <1, 0, 0>, speed2)
- define loc09 rotate(< 0, 6, 0>, <1, 0, 0>, 120 + speed1)
- define loc10 rotate(< 0, 6, 0>, <1, 0, 0>, 120 + speed2)
- define loc11 rotate(< 0, 6, 0>, <1, 0, 0>, 240 + speed1)
- define loc12 rotate(< 0, 6, 0>, <1, 0, 0>, 240 + speed2)
- define loc13 rotate(< 0, 0, 6>, <0, 1, 0>, speed1)
- define loc14 rotate(< 0, 0, 6>, <0, 1, 0>, speed2)
- define loc15 rotate(< 0, 0, 6>, <0, 1, 0>, 120 + speed1)
- define loc16 rotate(< 0, 0, 6>, <0, 1, 0>, 120 + speed2)
- define loc17 rotate(< 0, 0, 6>, <0, 1, 0>, 240 + speed1)
- define loc18 rotate(< 0, 0, 6>, <0, 1, 0>, 240 + speed2)
-
- //
- // Now we make the blob out of spherical components sitting at the locations
- // that were defined above.
- //
- object {
- blob 0.8:
- sphere loc01, 1, 3,
- sphere loc02, 1, 3,
- sphere loc03, 1, 3,
- sphere loc04, 1, 3,
- sphere loc05, 1, 3,
- sphere loc06, 1, 3,
- sphere loc07, 1, 3,
- sphere loc08, 1, 3,
- sphere loc09, 1, 3,
- sphere loc10, 1, 3,
- sphere loc11, 1, 3,
- sphere loc12, 1, 3,
- sphere loc13, 1, 3,
- sphere loc14, 1, 3,
- sphere loc15, 1, 3,
- sphere loc16, 1, 3,
- sphere loc17, 1, 3,
- sphere loc18, 1, 3
- mirror
- }
-
- //
- // Just for fun, there are six glass balls inside the blob components. Each
- // ball sits at the vertex of an octahedron. As the animation progresses the
- // balls rotate around.
- //
- object {
- object { sphere < 3, 0, 0>, 1 glass }
- + object { sphere <-3, 0, 0>, 1 glass }
- + object { sphere < 0, 3, 0>, 1 glass }
- + object { sphere < 0,-3, 0>, 1 glass }
- + object { sphere < 0, 0, 3>, 1 glass }
- + object { sphere < 0, 0,-3>, 1 glass }
- rotate <speed1, speed2, 0>
- }
-
- // Now to make a floor. Pretty standard sort of thing, a big disc with
- // several colorful textures.
- define cloudy_sky
- texture {
- noise surface {
- ambient 0.9
- diffuse 0
- specular 0
- turbulence 6.0
- position_fn 2
- lookup_fn 1
- octaves 4
- color_map(
- [0.0, 0.6, <0.4, 0.4, 0.4>, <1, 1, 1>]
- [0.6, 0.8, <1, 1, 1>, <0.196078, 0.6, 0.8>]
- [0.8, 1.0, <0.196078, 0.6, 0.8>, <0.196078, 0.6, 0.8>])
- }
- }
-
- define blue_ripple
- texture {
- noise surface {
- color <0.4, 0.4, 1.0>
- normal 2
- frequency 100
- bump_scale 2
- ambient 0.3
- diffuse 0.4
- specular white, 0.7
- microfacet Reitz 10
- }
- scale <10, 1, 10>
- }
-
- // Sorta marble-like texture. Couldn't decide what to call it...
- define thingy
- texture {
- noise surface {
- ambient 0.4
- diffuse 0.6
- specular white, 0.2
- microfacet Cook 4
- position_fn 1
- position_scale 1.1
- lookup_fn 1
- octaves 3
- turbulence 2
- color_map(
- [0.0, 0.3, <0.2, 0.7, 0.9>, <0.3, 0.6, 0.8>]
- [0.3, 1, <0.1, 0.6, 0.8>, <0.05, 0.4, 0.4>])
- }
- scale <0.3, 0.3, 0.3>
- }
-
- object {
- disc <0, -10, 0>, <0, 1, 0>, 1000
- texture { hexagon blue_ripple, thingy, cloudy_sky scale <20, 20, 20> }
- }
-