/* This script is supplied with the Mand2000 demo and release */
/* versions and may be freely distributed. */
/* Copyright 1993 Cygnus Software. */
/* An ARexx script for creating iteration movies. */
/* This script has been updated for Mand2000 version 2.0, and now creates */
/* animation files directly. */
/*
When Mand2000 calculates a picture, it stores the iteration counts
for each pixel, memory permitting. This means that if you calculate a
movie at an iteration count of, say, 1000, Mand2000 can redisplay that
picture the way it would look with an iteration count of any number under
1000, without doing any recalculating. This script makes use of that
features to allow fast and easy creation of iteration movies. These
animations can look quite impressive, as fractal fingers gradually take
over the black screen.
This script asks the user for some input to help it create a
reasonable movie. The first thing it asks for is the final iteration
count. After that it asks the user for the starting iteration count. For
best results let the picture completely calculate at the final iteration
count before you set it to the starting iteration count. Typically you
want the final iteration count to have pretty much all of the colour that
is going to appear be there. Typically you want the start iteration count
to make the picture black.
When you've set these values the script tells Mand2000 to ask
you for the name of an animation file to save the images to. This is
a substantial improvement over Mand2000 1.0, where the frames were
written out to separate files. If the iterations are changing too
quickly, or too slowly, you can adjust the IterInc, SpeedUpPoint and
IncDivisor values to tune your movie.
IterInc is the initial amount by which the iterations are
incremented after each frame.
SpeedUpPoint is the iteration count at which the iteration level
starts changing faster.
IncDivisor adjusts how quickly the increase speeds up. Smaller
numbers make it increase faster.
Because Mand2000 is live the whole time this movie is being
generated, you can also adjust things on the fly. If the final stages are
obviously taking too long you can use the max iterations requester to
manually increase the iterations, thus cutting out some of the unecessary
frames.
The resulting animation can be easily loaded into DPaint or any
animation player.
*/
portname = address() /* Retrieve the current port name. */
/* If the portname does not start with MAND2000 then this script must */
/* have been run with rx, rather than from Mand2000. Therefore we */
/* need to set the port name. We do not always set the port name */
/* because it is better to let Mand2000 set it for us, so that */
/* this script can be used with windows other than the one with */
/* port name MAND2000.1. */
if (left(portname, 8) ~= "MAND2000") THEN
address 'MAND2000.1'
options results
/* Settings for Axis Mand. */
/*IterInc = 1*/
/*SpeedUpPoint = 12*/
/*IncDivisor = 15*/
/*SpeedUpPoint2 = 300*/
/*IncDivisor = 9*/
/* Settings for I like this one. */
/*IterInc = 2*/
/*SpeedUpPoint = 115*/
/*IncDivisor = 6*/
/*SpeedUpPoint2 = 115*/
/*IncDivisor2 = 6*/
/* Settings for Nautilus. */
IterInc = 2
SpeedUpPoint = 235
IncDivisor = 40 /* was 17 */
SpeedUpPoint2 = 700
IncDivisor2 = 5
/* Settings for Generic 1. */
/*IterInc = 1*/
/*SpeedUpPoint = 15*/
/*IncDivisor = 10 /* was 17 */*/
/*SpeedUpPoint2 = 700*/
/*IncDivisor2 = 5*/
/* Settings for Needle. */
/*IterInc = 2*/
/*SpeedUpPoint = 315*/
/*IncDivisor = 10*/
/*SpeedUpPoint2 = 475*/
/*IncDivisor2 = 6*/
/* Settings for all the way out. */
/*IterInc = 2*/
/*SpeedUpPoint = 75*/
/*IncDivisor = 9*/
/*SpeedUpPoint2 = 128*/
/*IncDivisor2 = 4*/
/* Settings for spiral galaxy. */
/*IterInc = 2*/
/*SpeedUpPoint = 90*/
/*IncDivisor = 9*/
/*SpeedUpPoint2 = 90*/
/*IncDivisor2 = 9*/
/* Settings for double spiral. */
/*IterInc = 25*/
/*SpeedUpPoint = 3500*/
/*IncDivisor = 6*/
/*SpeedUpPoint2 = 3500*/
/*IncDivisor2 = 6*/
/* Parse out the command option. This script is called when the */
/* user wants a movie started, when the user wants a movie */
/* aborted and whenever one of the pictures in the sequence is done. */
parse arg command
command = upper(command) /* Make sure the command is in upper case. */
if (command = START) then
CALL StartIterMovie()
else if (command = STOP) then
CALL StopIterMovie()
else
CALL ContinueIterMovie()
Exit
CleanupStartup:
/* Turn the maxiters requester off, if that's how it started. */
if (maxitersstate = 0) THEN
REQUESTER MAXITERS OFF
/* Reset the MinimizeHammies flag. */
MINIMIZEHAMMIES minhammiesflag
RETURN 0
StartIterMovie:
DECPAUSE /* Allow Mand2000 to resume calculating while this script executes. */
REQUESTER MAXITERS /* See whether the maxiters requester is up already. */
maxitersstate = RESULT
REQUESTER MAXITERS ON /* Force it to be up regardless. */
MINIMIZEHAMMIES
minhammiesstate = RESULT;
if (minhammiesstate == 1) THEN
minhammiesflag = "ON"
else
minhammiesflag = "OFF"
MINIMIZEHAMMIES OFF /* Force this flag off - having it on makes for really badly compressed animations. */
REQUESTRESPONSE "This ARexx script makes an|animation by having the maximum|iterations of a fractal picture|increase from frame to frame.|Select `Continue' on this|requester when you have set max|iters to the desired finish value.|You should set it to the smallest|value that causes all, or almost|all, coloured pixels to be filled|in, then wait for the picture to|finish calculating before|selecting `OK'."
if (RC == 3) THEN DO
CALL CleanupStartup
RETURN 0
END
GETATTR stem PROJ
CALL SETCLIP("Mand2000IterEnd", PROJ.MAXITERS)
/* Try to make sure that the high iteration picture is finished before continuing. */
/* This allows Mand2000 to create the animation MUCH faster. If you wanted to you */
/* could change the script so that it loops until the picture is done. */
if (PROJ.DONE ~= 1) THEN DO
REQUESTRESPONSE "Click `OK' when this|picture finishes calculating."
if (RC == 3) THEN DO
CALL CleanupStartup
RETURN 0
END
END
REQUESTER MAXITERS ON /* Force it to be up regardless. */
REQUESTRESPONSE "Now click `OK' when you have|set max iters to the desired start|value for the animation.|Typically you will want to set it|to the highest value where the|screen is all black."
if (RC == 3) THEN DO
CALL CleanupStartup
RETURN 0
END
/* Turn the maxiters requester off, if that's how it started. */