/* This script is supplied with the Mand2000 demo and release */
/* versions and may be freely distributed. */
/* Copyright 1993 Cygnus Software. */
/* An ARexx programming for creating iteration movies. */
/*
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 keep
redrawing the picture starting at the low iteration count and working up.
The successive frames are saved to the Ram Disk as ITERFRAME10001 and
upwards. The base frame name can be changed by editing this script. 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 sequence of frames can be easily loaded into DPaint
or any other program for creating animations.
This script will, optionally, use ADPro to create an animation file out
of the individual frames as they are generated. This saves time and
reduces the user intervention required to create a movie. Also, if the
script were modified so that the frames were deleted off of the disk as
soon as they had been put into the Anim, the disk space required would be
reduced.
*/
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 I like this one. */
/*IterInc = 2*/
/*SpeedUpPoint = 115*/
/*IncDivisor = 6*/
/*SpeedUpPoint2 = 115*/
/*IncDivisor2 = 6*/
/* Settings for Nautilus. */
/*IterInc = 2*/
/*SpeedUpPoint = 220*/
/*IncDivisor = 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
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. */
REQUESTNOTIFY "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 `Continue'."
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
REQUESTNOTIFY "Click `Continue' when this|picture finishes calculating."
REQUESTER MAXITERS ON /* Force it to be up regardless. */
REQUESTNOTIFY "Now click `Continue' 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."
/* Turn the maxiters requester off, if that's how it started. */
if (maxitersstate = 0) THEN
REQUESTER MAXITERS OFF
/* Put a command in the user menu for stopping the movie creation. */
menu '"------------------------"'
menu '"Stop Iter Movie"' itermovie stop
INCPAUSE /* Stop calculations again. */
CALL SETCLIP("Mand2000FrameNum", 10001)
/* Tell Mand2000 to call this script whenever a pictures finishes calculating. */
EVENTACTION PICTUREDONE IterMovie
GETATTR stem PROJ
/* Assume that ADPro is not wanted. */
CALL SETCLIP("ITERTOADPRONAME")
/* Then ask if it is. */
REQUESTRESPONSE "Would you like the frames|written to an anim file|by ADPro?"