#!/usr/bin/perl
use CGI;
$query = CGI::new();
print $query->header();

$keywords = "fractal flame, flame, fractal, mathematics, graphics,
free software, art, artificial life, alife";

$descr = "The original Fractal Flame gallery and home-page, including downloadable software, source code, and a mathematical explanation.";

print $query->start_html(-title=>"FLAM3",
			 -BGCOLOR=>"black",
			 -TEXT=>"#a88686",
			 -LINK=>"#a88686",
			 -VLINK=>"#a88686",
			 -meta=>{'keywords' => $keywords,
				 'description' => $descr});

$menu = $query->param("menu");

if (!defined $menu) {
    $menu = "about";
}

sub mk_menu {
  my ($cur, $name, $url, @items) = @_;
  $res = '<table bgcolor="#433333" cellpadding=3><tr><td>' .
      '<table bgcolor="#202020" cellpadding=8 cellspacing=0><tr>';
  foreach $i (@items) {
    $j = $i->[1];
    $i = $i->[0];
    if ($j eq $cur) {
      $st = 'bgcolor="#223848"';
    } else {
      $st = "";
    }
    $res .= "<td $st><a href=$url&$name=$j>$i</a></td>\n";
  }
  $res .= "</tr></table></table>\n";
  return $res;
}

sub mk_tile {
    my ($n) = @_;
    
    return "<td><a href=http://draves.org/pix/frame3.cgi?" . 
	"zoom=1&dir=flames&file=$n.jpg><img src=$n-128.jpg " .
	    "width=128 height=128 border=0></a></td>";
}

$menu_html = mk_menu($menu, "menu", "index.cgi?",
		     ["about", "about"],
		     ["galleries", "galleries"],
		     ["animation", "animation"],
#		     ["children", "children"],
#		     ["talk", "talk"],
#		     ["doc", "doc"],
		     ["code", "code"],
		     ["wiki", "wiki"]
#		     ["press", "press"]
);

print <<eos;
<center><table><tr><td valign=top height=490 width=520><center>
<b><em><font face="verdana, sans-serif" size=4>FLAM3.COM</font></em><br>
<font face="verdana, sans-serif" size=5>The Flame Algorithm
</font></b><br><p>
$menu_html<p></center>


eos


if ($menu eq "about") {
    print <<eos;

<em>Flames</em> are algorithmically generated images and animations.
The software was originally written in 1992 and released as open
source, aka free software.  Over the years it has been greatly expanded, and is now widely used to create art and
special effects.  The shape and color of each image is specified by a
long string of numbers - a genetic code of sorts.  <p>

<center>

<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/GdIjCSi1XOk?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/GdIjCSi1XOk?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

</center><p><br>

You can create your own flames with <a
href=http://fr0st.wordpress.com/>Fr0st</a> (cross-platform and
scriptable in python), the <a href=http://apophysis.org>Apophysis</a>
interactive designer (for windows), <a href=http://apophysis-7X.org/>Apophysis 7X</a> the improved version, <a
href=https://github.com/bitsed/qosmic>Qosmic</a> (for
Linux), or <a
href=http://draves.org/blog/archives/000365.html>Oxidizer</a> (for Mac
OS X), or <a href=http://www.andreas-maschke.com/?page_id=42>JWildfire</a> (java cross platform).  <p>Or you can use the <a
href=http://electricsheep.org>Electric Sheep</a> distributed screen
saver to join the collective evolution and animation of flames.

eos

} elsif ($menu eq "animation") {
    print <<eos;


<center>
<a href=http://electricsheep.org><img src=sheep-logo.png border=0></a>
<p>

See <a href=http://electricsheep.org>Electric Sheep</a> to see infinitely evolving animated flames.  <p>
<a href=http://www.archive.org/details/HighFidelityDemo><img src=hifi-sample-filmstrip.png border=0></a>
<p>
Or watch the archive copy of the <a href=http://www.archive.org/details/HighFidelityDemo>High Fidelity Demo</a> in 1080p.
<p>
<a href=http://www.youtube.com/results?search_query=electric+sheep+-extreme>
<img src=yt-sheep.png border=0></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href=http://www.youtube.com/results?search_query=fractal+flames>
<img src=yt-flames.png border=0></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href=http://www.youtube.com/results?search_query=apophysis>
<img src=yt-apo.png border=0></a><p>

Or see these queries on YouTube: <a href=http://www.youtube.com/results?search_query=electric+sheep+-extreme>Electric Sheep</a>, <a href=http://www.youtube.com/results?search_query=fractal+flames>Fractal Flames</a>, and <a href=http://www.youtube.com/results?search_query=apophysis>Apophysis</a>.</center>

eos
} elsif ($menu eq "galleries") {

    print <<eos;
<center>
<a href=http://scottdraves.com/prints.html><img src=fine-art-gallery.png border=0></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href=https://photos.google.com/album/AF1QipMXmENIvtcPcH3nXaPvjd0hU4qrFmC7bppVJmr4><img src=flame-exhibitions.png border=0></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href=http://draves.org/pix/flames/><img src=original-gallery.png border=0></a>
</center>
<p>
See my portfolio of <a href=http://scottdraves.com/prints.html>fine art prints</a>,  <a href=https://photos.google.com/album/AF1QipMXmENIvtcPcH3nXaPvjd0hU4qrFmC7bppVJmr4>photographs of flame exhibitions</a>, and the <a href=http://draves.org/pix/flames/>original flame gallery</a> from 1993.<p>

<center><a href=https://photos.google.com/album/AF1QipOp-JmUuxr_PRjf_0nDhCvDGYeYjezBSB5AEqiG><img src=flames-by-others.png border=0></a></center><p>
Or see a gallery of images of <a href=https://photos.google.com/album/AF1QipOp-JmUuxr_PRjf_0nDhCvDGYeYjezBSB5AEqiG>commercial work by others</a> using the Flame algorithm.<p>

<center>
<a href=http://www.google.com/images?q=fractal+flame><img src=google-fflames.png border=0></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href=http://www.google.com/images?q=apophysis><img src=google-apo.png border=0></a>
</center><p>

Or try a Google image search for <a href=http://www.google.com/images?q=fractal+flame>flames</a>, or <a href=http://www.google.com/images?q=apophysis>apophysis</a>.




eos



}
elsif ($menu eq "children") {
$menu2 = $query->param("menu2");
if (!defined $menu2) {
    $menu2 = "plugin";
}
$menu2_html = mk_menu($menu2, "menu2", "index.cgi?menu=children",
		      ["plug-in", "plugin"],
		      ["screen-saver", "screensaver"],
		      ["stand-alone", "standalone"]);
print <<eos;
<center><h3>Software Incorporating Fractal Flames</h3></center>
<center>$menu2_html</center><p>
eos

if ($menu2 eq "plugin") {
    print <<eos;

The <a href=http://www.gimp.org>GIMP</a> comes with a flame
plug-in with an interactive editor.  The old documentation page is <A
href=http://draves.org/gimp/flame.html>here</a>.<p>

<a href=http://metacreations.com>MetaCreations</a> incorporated the
flame code into Kai's Power Tools (KPT) version 5 and dubbed it
FraxFlame.  It was updated in KPT6 and eventually sold to <a
href=http://corel.com>Corel</a>.  It's now available as the <a
href=http://corel.com/kpt>KPT Collection</a>.<p>

For animation, try the <a href=http://aeflame.com/>After
Effects plug-in</a> from neosapien, or <a
href=http://www.komkomdoorn.com/events/e_vlam.htm>vlam</a> the Digital
Fusion plug-in (download it <a
href=http://www.komkomdoorn.com/order/order.htm>here</a>).  A new
version of AEFlame for OSX and AE5.5 is <a href=AEFlame.sit>here</a>
as is the <a href=AEFlame_src_991018_Folder.sit>source code</a>,
thanks to <a href=http://buena.com>Darrin Cardani</a>.

eos
} elsif ($menu2 eq "screensaver") {
print <<eos;

The flame code runs in <a
href=http://gwyn.tux.org/~bagleyd/xlockmore.html>xlock</a> and <a
href=http://www.jwz.org/xscreensaver>xscreensaver</a>.<p>

<a href=http://electricsheep.org>electric sheep</a> is an internet
distributed screen-saver that renders flame animations.<p>

The <a href=http://www.webthing.net/settingsun/>Setting Sun</a>
screensaver for Macintosh now has flame mode thanks to Dair Grant.<p>

there's a <a
href="http://home.kabelfoon.nl/~rhordijk/progs.html#flame">Windows
Flame Screen Saver</a> from Ronald Hordijk.<p>

<a href=http://xochi.com>xochi</a> is distributing a flame animation
with iscreensaver for macintosh.


eos
} elsif ($menu2 eq "standalone") {
print <<eos;

Windows users may enjoy Mike Sargent's <a
href=http://www.uvm.edu/~msargent/main.htm>Quintessential
Sophistry</a> version of flame.<p>

<a href=http://www.apophysis.org/>Apophysis</a> is Mark Townsend's
rendition of the flame algorithm for Windows in Delphi Pascal.  It can
render images by itself or produce parameter sets for <a
href=http://ultrafractal.com>UltraFractal 3</a>, which supports the
flame algorithm thanks to Erik Reckase.  The latest beta version is
available from <a
href=http://sourceforge.net/projects/apophysis/>SourceForge</a>.
<p>

<a href=http://kandid.sourceforge.net/>Kandid</a> is a generalized
genetic art designer that includes fractal flames as well as many
other algorithms.<p>

Adrian Robert's <a
href=http://zakros.ucsd.edu/~arobert/IfsNewIms/>randim</a> ifs
renderer employs flame's log-density technique to good effect.



eos
}

} elsif ($menu eq "talk") {
print <<eos;

Please use the <a href=http://community.electricsheep.org/forum/2>forum</a>.

eos


} elsif ($menu eq "doc") {

    print <<eos;

<center>
<h3>Documentation</h3>
</center>

<p> Documentation is available on a <a
href="http://code.google.com/p/flam3/w/list">wiki</a>.  The XML file
format is covered at the end of <a href=flame_draves.pdf>this paper</a> and
there are examples of all the palette values <a
href=http://draves.org/pix/palettes/>here</a>.  And there's a <a
href=http://electricsheep.org/apophysis/>tutorial</a> about how to use
Apophysis to design your own animations.

eos

} elsif ($menu eq "code" || $menu eq "download") {

    print <<eos;

<center>
<h3>Source Code and Binaries</h3>
</center>

It's all <a href=http://www.fsf.org/philosophy/free-sw.html>free software</a>,

aka

<a href=http://opensource.org/docs/definition.php>open source</a>,
licensed under the <a href=http://www.gnu.org/copyleft/gpl.html>GPL</a>.<p>

The <a href=https://github.com/scottdraves/flam3>source
code</a> is hosted by Github.  This package provides command line
rendering of high resolution still images and animations.  It runs on
Linux and Windows.  Scott Draves is the founder and architect, and
Erik Reckase is responsible for development starting with version
2.7.<p>

The <a
href=README.txt>README</a> contains the documentation and changelog.
More documentation can be found on the <a
href=https://github.com/scottdraves/flam3/wiki/>wiki</a>.<p>

The source code includes a regression testing script.  <a
href=flam3-2.7.15-reference.zip>Reference</a> images are available for
download.<p>

There's an archive of the <a href=flam3-sourceforge-svn-archive.tgz>old SVN tree</a> if you care to see more history.
<p>

eos
} elsif ($menu eq "wiki") {

    print <<eos;

<center><a href=http://en.wikipedia.org/wiki/Fractal_flame><img src=flam3-wikip.png border=0></a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href=https://github.com/scottdraves/flam3/wiki><img src=flam3-mywiki.png border=0></a><p>
Learn more on the <a href=http://en.wikipedia.org/wiki/Fractal_flame>Wikipedia</a> or <a href=https://github.com/scottdraves/flam3/wiki>our github wiki</a>.<p>

<p>Read a <a href=flame_draves.pdf>paper</a> about the mathematics behind
them.<p>
<a href=flame_draves.pdf><img src=flame-paper-thumb-strip.png border=0></a>

</center>

eos

} elsif ($menu eq "press") {
    print <<eos;

<center>
<h3>Press Coverage and Major Exhibitions</h3>
<h4>excluding <a href=http://electricsheep.org/index.cgi?&menu=press>Electric Sheep</a></h4>
</center>

DIVA magazine (Japan) has two page spread of flame images and text.<br>
Issue 2002#3

<p>

Art, Science & Technology at <a
href=http://www.artisans-marin.org/artisans/index.htm>Artisans
Gallery</a>, Mill Valley California, 7/2001<br> <a
href=http://draves.org/pix/frame3.cgi?zoom=1&dir=flames&file=191.jpg>Flame
#191</a> received Best of Show.

<p>

<a href=http://wired.com/wired/current.html>Wired Magazine</a>,
two-page spread of <a
href=http://draves.org/pix/frame3.cgi?zoom=1&dir=flames&file=148.jpg>Flame #148</a>, <br> San Francisco California, 5/2001.

<p>

<a href=http://siggraph.org/artdesign>SIGGRAPH Art Show</a> exhibited <a
href=http://draves.org/pix/frame3.cgi?zoom=1&dir=flames&file=012.jpg>Flame #12</a>.  Orlando, Florida 1994.

<p>

<a href=http://www.aec.at/en/index.asp>Prix Ars Electronica</a>, Linz Austria, 9/1993<br> <a
href=http://draves.org/pix/frame3.cgi?zoom=1&dir=flames&file=149.jpg>Flame #149</a> (first edition) received an Honorable
Mention.

<p>

eos
}

print <<eos;
</td></tr></table>

<p>

<table bgcolor="#433333" cellpadding=3><tr><td>
<table bgcolor="#202020" width=520 cellpadding=5><tr>
<td align=left><a href=http://electricsheep.org>electric sheep</a></td>
<td align=center>
<em>here be gnarl</em>
</td>

<td align=right><a href=http://scottdraves.com/for-sale.html>buy art/prints/video/clothes</a></td></tr></table>


</td></tr></table>

<p><br><p>


<font face="verdana, sans-serif" size=1><em>This work is licensed under a
<a href="http://creativecommons.org/licenses/by-sa/2.0/">Creative
Commons License</a> by <a href="http://draves.org">spot at draves
dot org</em></a>.</font> <p>


</center>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4775853-3");
pageTracker._initData();
pageTracker._trackPageview();
</script>

eos

print $query->end_html();

