Sample animation code

Icon


Contents:

1   Overview
2   GIMP-Perl animation
3   Lunar Phases animated GIF
4   Lunar Phases AVI video



1. Overview.

This page is intended for Perl coders.

This page provides three simple animations that I created using FOSS tools, including some tools of my own, and provides source code for the tools that I wrote. The source code isn't guaranteed to work for anybody else, but it may be useful as a starting point for some projects. License information is provided at the top of each source file.

Software requirements are listed in each section.




2. GIMP-Perl animation.

Image

This is an animated GIF that I created using GIMP 2.2 and a GIMP-Perl script. The animals are clip art from a game that I call StarGnud (it's my version of Clive Crous's noeGNUd). The rotating globe is generated entirely by GIMP-Perl calls. The globe algorithm is based on GIMP “planet” code written by daoo.

Note: The image file is larger than most animated GIFs. It may “stutter” (i.e., stop and start) on slower PCs.

To browse the source code, click here. To download the source code and data files used, click here.

Requirements: Linux, Perl 5.8 or 5.10, GIMP 2.2 (see note below), GIMP-Perl 2.2, ImageMagick 6.3 or above, gifsicle 1.48 or above, and intergif 6.15 or above.

Note: This animation requires a copy of GIMP from the 2.2 series. If you've got a release that's older or newer, you may not be able to build the animation. Reason: GIMP-Perl is an orphaned project that only works reliably with GIMP 2.2.




3. Lunar Phases animated GIF.

Image

This is an animated GIF that I created using two Perl scripts named moonphase2avi and moonphasepic.

moonphase2avi calls moonphasepic repeatedly to generate individual frames, then combines the frames to produce either an animated GIF or an AVI file.

To browse the moonphasepic source code, click here. To browse the moonphase2avi source code, click here.

To download both scripts and a required data file, click here. Note: The data file (albedo_simp750.jpg) is believed to be in the public domain.

Requirements: Linux, Perl 5.8 or 5.10, POV-Ray 3.6.1, mencoder (from 2008 or later), ImageMagick 6.3 or above, gifsicle 1.48 or above, intergif 6.15 or above, and Astro::MoonPhase 0.60 or above.





4. Lunar Phases AVI video.

The following ZIP file contains an AVI video clip that shows one month in the life of the Moon:

moonphaseavi.zip

Under MS-Windows, Media Player should be able to play the video clip. Under Linux systems, mplayer or vlc should work.

This example was created by the Perl scripts moonphase2avi and moonphasepic discussed previously.

To browse the moonphasepic source code, click here. To browse the moonphase2avi source code, click here. To download both scripts and the data file mentioned previously, click here.

Requirements: Linux, Perl 5.8 or 5.10, POV-Ray 3.6.1, mencoder (from 2008 or later), ImageMagick 6.3 or above, gifsicle 1.48 or above, intergif 6.15 or above, and Astro::MoonPhase 0.60 or above.





Hosting provided by Zymic.

For acknowledgments related to CSS and other code used, click here.

Linked or embedded works (software, books, articles, etc.) are presented under their own licenses.

Other unique content on this page, excluding screenshots, is distributed under the following license: C.C. Attribution NonCommercial ShareAlike 3.0. In some cases, screenshots are distributed under the same license. In other cases, the associated program's license applies.

image Valid XHTML 1.0