SPROGS now contains a set of high level routines to produce some of the effects required in animation. This consists of seven routines to perform various operations on region parameters and two wipe facilities.
(1) ZOOM(REGN,XCEN,YCEN,FACT,FRMS,FARIN)
will perform a zoom lasting FRMS frames in region REGN. The centre of the zoom will be (XCEN,YCEN) and the size of the region will be enlarged by a factor FACT. (FACT<1.0 will cause a zoom-out). If FARIN =1.0 the zoom will be faired.
(2) SPIN(REGN, FRMS)
will rotate region REGN through 180 degrees about a vertical axis through the centre of that region, over a period of FRMS frames. Repeated use of this routine will produce continuous spinning.
(3) FLIP(REGN,FRMS)
as SPIN except rotation is about a horizontal axis.
(4) PAN(REGN, DIST, FRMS, FARIN)
moves region REGN a distance DIST in a horizontal direction in FRMS frames. Note that motion is relative to the region in which REGN is defined and therefore DIST refers to that coordinate system. If FARIN =1.0 the motion will be faired. A value of DIST greater than zero will produce left to right movement of the region.
(5) TILT(REGN,DIST,FRMS,FARIN)
as PAN, except motion is in a vertical direction. DIST>0.0 will produce upward motion.
(6) SQUASH(REGN, FACT, FRMS, FARIN)
will cause region REGN to decrease in the y direction by a magnification factor FACT. (FACT>1.0 produces expansion in size.) Motion is symmetrical about the centre of the region.
(7) SQUEZE (REGN, FACT, FRMS, FARIN)
performs the same action as SQUASH but in the x direction.
Each of the above routines may only be called from within a file definition (STDF-FIDF), and this file must be executed in the sequence list with other film files which produce the information on the film. These routines are not display routines in themselves, but only contain display routines which will be stored in the SPROGS file and executed in the sequence list in the normal way. The last display routine to be stored will be DRAW which, when the file is executed, will cause the execution of a system film file which will change the limits of region REGN.
The only limitation is that if a BASIC file (STSAV-FISAV) is in the sequence list it will not be affected by any of the functions. Note also that a function may only be in use once at any one time.
Consider the following:
If we have three film files as follows:
CALL STDF (BOX) CALL REGION(2.0) CALL SETXY (10.0,10.0) CALL BOXR (40.0,30.0) CALL ADVFLM CALL REPEAT CALL FIDF (1.0) CALL STDF(SPFL) CALL SPIN(2.0,48.0) CALL FIDF(1.0) CALL STDF (ZMPL) CALL Z00M(2.0,25.0,20.0,4.0,48.0,1.0) CALL STOPSQ CALL FIDF(1.0)
The first will repeatedly produce a box in region 2.0 and ZMFL and SPFL will contain SPROGS display routines to perform a ZOOM and SPIN respectively, in this region. It would be executed by:
CALL ADSQLG (BOX,0.0,0.0) CALL ADSQLL(SPFL,0.0,0.0) CALL DRAW (ZMFL)
A ZOOM and a SPIN will be produced in region 2.0, lasting 48 frames. This will consist of a 180 degree rotation of the box at the same time as a ZOOM-IN of magnification 4.0 on the point (25.0,20.0). Any number of the functions may be used at any one time.
Two wipe routines have been written to allow for either a wipe between two static scenes or a wipe between sequences that contain movement.
(1) WIPE (REGN,F1,FN01,F2,FN02,FRMS,TYP)
produces a still wipe between PICTURE file F1, number FN01 and PICTURE file F2/FN02 over FRMS frames. The wipe will be in region REGN and the parameter TYP specifies the type of wipe required as follows.
TYP WIPE 1.0 Right to left 2.0 Left to right 3.0 Top to bottom 4.0 Right to left push 5.0 Left to right push 6.0 Square out from centre 7.0 Out from centre, horizontally 8.0 Out from centre, vertically 9.0 From the top left hand corner
This routine reads the current region limits at the time it is called and calculates the various intermediate region limits during the wipe. The files F1 and F2 are DRAWn on each frame and an advance film order issued.
To wipe over only a part of the film frame, whilst producing information on the rest of the frame, this routine may be called from within a file in the sequence list. F1 and F2 must contain a call of REGION(REGN) at the beginning, where REGN is the wipe region.
(2) MVWIPE(F1,FN01,F2,FN02,FRMS,TYP)
will produce a wipe between FILM files F1/FN01 and F2/FN02 over FRMS frames. The type of wipe is again specified by TYP and may be any one of the first four mentioned above.
This moving wipe is implemented using two system film files in a similar way to ZOOM etc. These are added to the sequence list to work in parallel with F1 and F2, which are also added by this routine, and any other film files that may be in the sequence list.
If TYP is out of range in either routine, an error message will be printed and type 1.0 assumed.
The system film files are held in:
:SLIB.SPSYSLIB4
and are accessed in the same way as the fonts. A routine, GETHI has been written which will on-line SPSYSLIB4 and bring each of the files into the filestore.
The source for the film files may be found in:
:SLIB. SYSLIB4GEN
and the library may be regenerated by:
RJ ALGENMOP,:SLIB.HIGHGEN
As various index variables have been used by this system the following convention has been strictly followed to prevent user duplication of names. Each name consists of four characters. The first defines the function to which it is associated, the next two define the index variable and the fourth is a COLON. Each of the film file names consists of three letters and a colon.
Mention has been made of the fairing option. For this purpose a fairing display routine has been written:
FAIRDS (XINVR,FRMS,FRNO,TYP)
which is called once for each frame during the motion and will load into index variable XINVR, a fairing value (given as a percentage between 0.0 and 1.0) calculated from the total number of frames, FRMS, and the present frame number of the motion, FRNO. The type of fairing is defined by TYP as follows:
TYP = 0.0 will give an incremental fairing value such that the sum of all values for a particular motion will be 1.0. This allows the distance of motion to be calculated for any particular frame. TYP = 1.0 will produce an accumulative fairing value between 0.0 and 1.0 and is used if all motion is relative to a starting point.
The fairing is a straightforward ease-in, ease-out and is calculated from the cosine function. In the routines described earlier, if fairing is selected, then fairing of TYP =0.0 is used.
There is also a FORTRAN function to produce the same results as above with the same parameters:
FAIR (FRMS,FRNO,TYP)