The Maplesoft office is currently in the process of being burried in snow and many of us are getting ready to head off for the holidays.  Before leaving, I wanted to share this great animated GIF created using 3d plots.  It was sent to me by Bruce Char at Drexel University. The greeting and the Maple script to generate it are after the break.

5480_card600-op.gif

# This script creates an animated gif from a Maple animation.
# It takes about three or four minutes to execute on one of the
# CS department Linux workstations.
# To execute, do "maple -q < card08.mpl" at the command line

# Author:  B. Char, 12/2008.
# Minor modifications by J. May

#Message greeting
text := plots[textplot3d]([[.5, .5, 3, "May the Peace and Joy", 
   font = [TIMES, BOLD, 18], color = "HotPink"]]);
text2:= plots[textplot3d]([[.5, .5, 2.5, "of the season be", 
   font = [TIMES, BOLD, 18], color = "HotPink"]]);
text3:= plots[textplot3d]([[.5, .5, 2.0, "with you the entire year",
   font = [TIMES, BOLD, 18], color = "HotPink"]]);

#Draw the tree
treeRadius := .7;
treeHeight := 5;

tree := plottools[cone]([0, 0, 5], .7, -5, color = "DarkGreen", 
  style = surface, glossiness = .8, numpoints=1200);
trunk := plottools[cylinder]([0, 0, -1], .1, 1, color = "Tan", 
  style=surface);
base := plottools[cylinder]([0, 0, 0], treeRadius, 0.1e-1, 
   color = "DarkGreen", glossiness = .1, style=surface);
star := plots[polyhedraplot]([0, 0, treeHeight], polytype = 
   GreatStellatedDodecahedron, polyscale = .3, color = "yellow", 
   scaling = constrained, glossiness = 1, style=surface);

# The ribbon is a tubeplot winding around the cone that is the tree. 
# You have to know the math formulae for the cone in order to get this right.
ribbon := plots[tubeplot]([treeRadius*(1-t/(6*Pi))*cos(t), 
   treeRadius*(1-t/(6*Pi))*sin(t), 5*t/(6*Pi)], t = 0 .. 5*Pi, radius = .1, 
   color = "blue", numpoints = 30, transparency = .2, 
   glossiness = .8, style=surface);

#String the lights
#Draw one light at the specified point and color on  the tree.
lightfunc := proc (theta, h, c)
      plottools[sphere]([treeRadius*(1-h/treeHeight)*cos(theta), 
      treeRadius*(1-h/treeHeight)*sin(theta), h], 0.5e-1, color = c, 
      style = surface)
end proc;

#Likelihood of light is proportional to the amount of tree at
# a particular height.
lightDistr := proc (x) 5-sqrt(2*x) end proc;
numLights := 100;

#Create a placement of lights and light colors at random.
lightHeights := seq(evalf(lightDistr((1/10)*(rand(1 .. floor((1/2)
   *treeHeight^2*10)))())), i = 1 .. numLights);


colors := ["Red", "Pink", "Orange",
 "Tomato", "Yellow", "DarkTurquoise",
 "Purple", "LightGreen", "DeepSkyBlue"];

numColors := nops(colors);

lights := seq(lightfunc(((1/1000)*(rand(0 .. 1000))()*2)*Pi, lightHeights[i],
    colors[rand(1..numColors)()]), i = 1 .. numLights):


# This function is used to decide whether a light is off or on
# in a particular frame, at random.
flipper := proc (x) piecewise((rand(1 .. 3))() <= 2, x, NULL) end proc;

numFrames := 90;

#Draw a frame of the movie
frames := seq(plots[display]([ribbon, tree, text, text2, text3, trunk,
                              base, star, op(map(flipper, [lights]))],
        scaling=constrained,orientation=[4*j,45], lightmodel=light2),
                                     j = 0 .. numFrames):

#Create the animation structure
movie := plots[display]([frames],insequence=true):

#Print it out as an animated gif file.
interface(plotdevice = gif,
          plotoutput = "test800.gif",
          plotoptions = `portrait,nobordermwidth=600,height=900`);

print(movie);


Please Wait...