SPROGS is a computer graphics system with an emphasis on computer animation. It combines many of the best features of previous systems. These features allow a user to define his own coordinate systems or regions in terms of other regions and of the plotting area, to clip and mask his graphical output, to name pictures and manipulate them and to split a film sequence into several simultaneous activities that are more conveniently handled individually. SPROGS also allows picture files to include parameters on which arithmetic operations can be performed.
Films can be made by writing a program for the host computer but can also be produced interactively via a satellite computer with an interactive refreshed display. An animator can define a picture or specify a dynamic change by sketching with a writing tablet or light pen. At any stage he can cause a single frame or a whole sequence to be shown on the CRT.
The paper describes how a batch-stream-user sees the system; it then describes how the interactive animator can take advantage of it and the further software available to him.
The production of graphical output from computers has grown over the last decade from a few two-dimensional graphs of single functions to a state where it is probably the only sensible way of producing large volumes of information in a form acceptable to the average human. With growth has come diversity. Users now require three-dimensional perspective views, shading, colour and most important motion. Many complex results can be simplified considerably by allowing a fourth dimension to be equated with time. SPROGS, SD4020-PDP15 Rapid Output of Graphics System, is under construction at the Atlas Computer Laboratory, Chilton. The aim is to provide a flexible graphical system which is available to a wide range of users both in their level of expertise and also the facilities they require. The system is open-ended and it is hoped that particular classes of users can extend the system to suit their requirements.
Our own interests are mainly in the area of computer animation and this is reflected in the parts of SPR0GS described in this paper. We have concentrated on those facilities designed specifically to aid the computer animator. Many are unlikely to be required by the user generating single pages of graphical output. It is possible for such a user to be unaware of the facilities described here. Full details of the complete system can be found in the Draft Manual (1).
Early graphic packages tended to be oriented more towards the output device than the user. Line drawing and character plotting was defined in terms of the fixed grid (frequently 1024 x 1024) of the device so that the user had to do the conversion from his own unit system to that of the device (2). Once graphical output was accepted it soon became necessary to introduce facilities which allowed the user to improve the quality of the output. Automatic conversion from one unit system to another was provided so that it was a simple matter to reposition output on the page. Software character generation, curve drawing and histogram production are examples of facilities frequently added to the basic package (3).
The advent of the microfilm recorder as an alternative to the pen plotter meant that graphical output could be produced much more quickly and to film rather than paper. The possibility of producing cine films became a reality. Software packages for microfilm recorders soon reflected the growing demand for computer animation. P0LYGRAPHICS (4), for example, allowed the user to define his output with reference to a number of distinct unit systems whose mapping onto the plotting area of the device could change in time. Clipping and masking of output were provided automatically. These facilities meant that standard camera movements (pan and zoom) and photographic effects (wipes and dissolves) could be produced. One important advance in packages for both pen plotters and microfilm recorders was automatic generation of perspective views of three-dimensional objects with or without hidden line removal (5).
More recently the adding of syntactic sugar enables more complex films to be readily made. Some systems (5, 6) have encouraged the user to save picture parts in core ready for later use. Routines are then provided to generate output from these. For example, key-frame animation is a facility often provided; the user provides the major frames of the output and the system interpolates the in-between frames.
Finally, the most important recent advance has been the progression from batch systems to interactive ones. GENESYS (7) allows the user to define his picture objects with a tablet attached to an interactive display. The path and timing of an object's motion could also be input. Playback in real-time would then lead to a modification-playback cycle until the user converged on the output he required.
The major design aims for SPROGS were:
Although SPROGS is intended to be portable, the Atlas hardware configuration may be of interest and the relevant equipment is shown in figure 1.
The main SPROGS system will operate on a paged ICL 1906A under the GEORGE 4 operating system. Programs can be input to the computer via the usual batch input, local terminals or remote job entry stations installed in universities. The major graphical output device is an SD4020 microfilm recorder driven by 7-track magnetic tape. The lineprinter is another graphical device useful for a batch user to obtain a quick check.
Attached to the ICL 1906A via a 1 Mbaud current driven British Standard Interface is a 32K PDP15. The PDP15 has ½M words of disc which is used for the operating system, program overlays and scratch areas. Interactive facilities are provided by a VT15 refreshed display with lightpen and pushbuttons, writing tablet for sketching, keyboard and a DMAC pencil follower for input of detailed graphical information.
SPROGS allows a user, by means of regions, to establish his own coordinate systems and relate them to the plotting area. A particular region R can be given its own unit system, defined by the following parameters:
R,XMIN,YMIN,XMAX,YMAX P,XPMIN,YPMIN,XPMAX,YPMAX CNV,SWOUTP
Further region parameters BSC,MI,MO are associated with the visibility of a line and mentioned later.
In the simplest conversion (CNV=O), any position (X,Y) defined in terms of the units of region R is equivalent to the position (X' ,Y') of region P where
X'=XPMIN+ (X-XMIN)(XPMAX-XPMIN) / (XMAX-XMIN) Y'=YPMIN+ (Y-YMIN)(YPMAX-YPMIN) / (YMAX-YMIN)
The rectangle bordered by X=XMIN,XMAX and Y=YMIN,YMAX in R corresponds to the rectangle bordered by X=XPMIN,XPMAX and Y=YPMIN,YPMAX in P. (It does not have to lie within the borders of P itself). A hierarchy of regions can be set up in this way. For example a room with a door upon which is a nameplate could have each object defined in terms of the previous one (door in terms of room, nameplate in terms of door). Movement of the door and its associated nameplate then requires only alterations in the conversion from the units for door to that of room.
Finally a region (S say) is associated with the drawing area of the graphical device currently selected. This association is indicated by a variable SWOUTP associated with the region S.
As in our earlier GROATS system, a region can define the visibility of a line. Consider a line drawn with respect to the region R which straddles the region. Some decision must be made as to whether or not the parts of the line exterior and interior to the region are visible. For example, if region P is the complete plotting area of the output device then it would be usual for the region to act as a window with the parts of the line exterior to the region being invisible. Again it is frequently useful to have the region acting as an opaque object which shields any drawing interior to itself allowing only those parts of the line exterior to the region to be displayed.
A line (A,D) drawn with respect to region R will usually be divided into a number of line segments some of which are defined as outside the region while others are inside. In the case of a rectangular region (BSC=O), the line (A,D) in Fig 2 is broken into segments (A, B) , (B,C) and (C,D). The coordinates are then converted into the units of region P.
With each line segment is associated a visibility variable IV having either the value visible or invisible. The region conversion associates a new value, IV', with each of the line segments depending on whether the segment is inside or outside the region. Two variables, MI and MO, associated with the region define whether the converted segments (inside and outside respectively) are visible or invisible. Using M to indicate either MI or MO then:
M=0 IV' = invisible M=1 IV' = IV M=2 IV' = not IV M=3 IV' = visible
For example a region which scissors the output at the region boundary (and leaves invisible segments invisible) would have MO=0, MI=1. The process is then repeated with lines AB,BC and CD (they might not all exist) with respect to region P and so on until the terminal region is reached.
Note that a decision on whether a line is visible or not is reversible until the terminal region is reached. In figure 3 a set of parallel lines has been drawn with respect to region 2 which is square and has MI=1,MO=0. Region 2 is defined in terms of region 1, the long thin region which has MI=1,MO=2; this is defined on region 0, which is a simple window and is associated with the plotting area.
The generality available with a deeply nested set of regions with different MI and MO is not always necessary. However it is useful for film effects such as dissolves and wipes. Also generality does not increase the complexity of the transformations.
Note that by varying suitable coordinate system parameters, standard camera movements such as pan and zoom are easily obtainable.
The full possibilities of region definitions have not been given here. Different settings of CNV, for example, allow conversion from log scale and log log scale. Different settings of BSC allow regions of more general shape than rectangular. SPROGS will also allow 3-D information to be specified; this will probably be provided in a separate system. At some stage, the mapping of a 3-D object onto a 2-D perspective view has to be achieved by a region with a special setting of CNV.
In general graphical output from SPROGS is obtained by specifying operations to be performed on previously generated picture files. The simplest operation is to output the picture file with respect to the units of a particular region. Picture files, in their simplest form, are made up solely of commands to draw lines and plot characters. For example:
VEC(XI ,YI ,X2,Y2) draws a line between (XI,YI) and (X2,Y2) SETXY(X,Y) sets the current plotting position to (X,Y) TODXY(DX,DY) draws a line from the current plotting position (XPOS,YPOS) to (XPOS+DX,YPOS+DY) UPDXY(DX,DY) moves the current plotting position from (XPOS,YPOS) to (XPOS+DX,YPOS+DY)
The line drawing commands always leave the current plotting position at the end point. A complete set of routines are available but the ones above are sufficient for the examples below. Note that throughout this paper the word CALL has been omitted from the FORTRAN statements to improve readability. A simple picture file is defined by enclosing picture drawing commands between calls of the routines STDF and FIDF. Thus:
STDF (' CROSS' ) VEC (0,0,1,1) VEC (0,1,1,0) FIDF
defines a picture file called CROSS consisting of two intersecting lines. The CROSS could be output by calling:
REGION (3) DRAW ('CROSS')
which outputs the CROSS with respect to the units of region 3. picture file may have subfiles:
STDF (' FLAG' ) VEC (0,-1,0,1) VEC (0,1,1,1) VEC (1,1,1,0) VEC (1,0,0,0) DRAW ('CROSS') FIDF
Here the picture file FLAG has CROSS as a sub-file. These sub-files are, of course, more useful if the information is not absolute. Thus:
STDF ('CROSS') TODXY (1,1) UPDXY (-1,0) TODXY (1,-1) FIDF
defines a CROSS relative to the current plotting position. As it stands, the file FLAG would generate the same output. It would however, differ considerably if the call of the sub-file CROSS was positioned differently within the file.
As well as picture drawing commands, region definition and selection together with the setting of line parameters may be included within the picture file. Thus:
STDF ('CROSSES' ) REGION (1) THICK (2) VEC (0,0,1,1) VEC (0,1,1,0) REGION (2) INTNST (4) VEC (0,0,10,10) VEC (0,10,10,0) FIDF
This defines a picture file consisting of two crosses. The small cross is drawn with respect to the units of region 1 and has thicker lines. The large cross is drawn with respect to the units of region 2 and has extra dark lines.
By defining picture files relative to some external plotting position or alternatively changing the parameters associated with a region, it is possible for a single picture file to be used in a number of ways. Even more flexibility can be achieved if the picture files are allowed to have variable arguments in place of the constant ones normally associated with picture drawing routines. In SPROGS a set of index variables exist which are allowed in place of any picture drawing routine argument. Thus:
STDF ('TWOLINES') DRAW ('SPOT') TOXY (PR(9),10) DRAW ('SPOT') TOXY(40,0) DRAW ('SPOT') FIDF
draws a pair of lines with a movable point of intersection and their other ends fixed. Several possible manifestations of this file are shown in figure 4. ('SPOT' is a picture drawn at the current plotting position consisting of many short lines making up a large spot. The resultant effect on the plotting position is nil).
PR(9) therefore indicates that the argument of TOXY is not the constant 9 but the contents of index variable 9. We could construct a scene by DRAW('TWOLINES') on consecutive frames and changing the contents of 9 after each frame.
A more complex form of parameterization is allowed; one file can be used to provide parameters for a second. If in TWOLINES we had:
... ... TOXY(AR(9),10) ... ...
the argument of TOXY is a set of index variables starting at 9 which define a position in a second file which contains the required value.
A scene is produced by updating the position pointed at in the second file (the parameter file) after each frame; the parameter file describes the change of a parameter in time.
Picture files define objects which can be displayed on frames of output. An extension of the picture file, called the film file, allows a complete film sequence to be defined as the contents of a file. The distinction between the two types of file is that film files can contain the command ADVFLM which will normally cause the next frame to be started. Thus:
STDF ('FILM') TODXY (1,0) ADVFLM REPEAT FIDF
defines a film sequence which will go on for ever. The REPEAT command causes the file to be interpreted from the start again. If called by:
SETXY (0,0) DRAW ('FILM')
the file would produce a film consisting of the line (0,0) to (1,0) on the first frame, (1,0) to (2,0) on the second and so on.
The introduction of film files is particularly useful when a number of distinct movements appear in a film which proceed in parallel but possibly with different starting and stopping positions. The camera zooms in on a bouncing ball over which flies an aeroplane. Here, three independent motions can be defined as the film flies BALL, PLANE and ZOOM. Parallel execution of the three motions is achieved by:
ADSQLS ('BALL') [add named file to sequence list] ADSQLS ('PLANE') DRAW ('ZOOM')
A sequence list is kept of the film files being obeyed. With more than one film file in the sequence list, the ADVFLM orders for all but the last entry will cause the interpreter to move on and interpret the next entry in the list. The last entry causes the ADVFLM to take place and return control to the first item in the list. Figure 5 shows the execution path of a simple sequence list. (The (1)'s indicate the link between SEQ3 and SEQI).
In a more sophisticated film, the parameters associated with a particular motion may depend on another. A ball moves from left to right until it hits a wall whereupon the direction of motion is reversed. Given two walls, the ball can bounce backwards and forwards. Using index variables as parameters which define the positions of the left and right wall, the motion of the ball can be defined in a film file. Separate files can define the motions of the two walls. Changing the way the walls move does not require us to change the film file defining the ball's motion.
In order to set up files of this type it is necessary to have commands within the film file which allow conditional execution and to change the values of index variables. For example, the motion of the ball could be defined as:
STDF('BALLSQ') WHILE(BALLPS,LT,PR(RIGHTW)) where 'SHIFT' is defined by DRAW ('SHIFT') STDF('SHIFT') LOAD(BALLDX,-1) SETXY(PR(BALLPS),Q) WHILE (BALLPS,GT,PR(LEFTW)) DRAW ('BALL') DRAW ('SHIFT') ADD(BALLPS,PR(BALLDX)) LOAD (BALLDX,1) ADVFLM REPEAT FIDF FIDF
The index variable BALLPS contains the X value of the ball's position. The index variable BALLDX contains either 1 or -1, the increment in the ball's position between frames. The index variables, LEFTWL and RIGHTW contain the X coordinates of the left and right walls respectively. The WHILE command causes the following command to be obeyed repeatedly until the condition fails. Note that the effect of ADVFLM on the sequence list is as if it occurred in BALLSQ.
More complex interaction can be achieved by allowing film files to start, delete, suspend or resume other film files.
The preceding sections describe a system which will exist entirely within the ICL I906A. All the features are to be available to the card-user and the user of a multi-access terminal. However, SPPROGS has also been designed to allow the interactive production of a film and we explore the possibilities in this section.
The advantages of interactive animation are analogous to other interactive computer work:-
The interactive graphical equipment has already been described in section 4. We expect it to be used in several ways; for instance
The PDP15 software will send to the 1906A a stream of SPROGS commands. These are data records of the form (for example) TODXY,1,0 (or n,1,0 where n is some number representing TODXY) which is read by a command decoder and has the same effect as
CALL TODXY (1,0)
in a program. Any SPROGS routine has a data mode equivalent. The commands from the PDP15 will usually define picture files, manipulate index variables and send requests for pictures and sequences to be output.
It is possible to switch between data mode and program mode as the user wishes.
To the SPROGS system, the PDP15 is one of the several output options and needs no special status. The output stream will be display file code, interspersed with SPROGS commands to help editing from the PDP15.
The first version of PDP15 software to use SPROGS will provide the following facilities.
A picture can be drawn and named; the lightpen, writing-tablet or DMAC can be used. The picture can be sketched or constrained to follow a grid and then modified as the user wishes. When he is satisfied, it is converted to SPROGS commands and sent to the 1906A to be stored as a SPROGS file. Several versions of a picture (for instance mouth closed and deadpan, mouth smiling, mouth open) can be drawn and defined as a eel-class. They are given the same name but different numbers. In SPROGS this is expressed as
NUMBR,1 STDF,'MOUTH' ... FIDF NUMBR,2 STDF,'MOUTH' ... FIDF ... NUMBR,2 DRAW,'MOUTH' ...
An animator will be able to specify a change in time by drawing with a pen and writing tablet. For instance, the trajectory of a bouncing ball can be expressed by moving a pen with a suitable action; the action expresses the actual movement as well as the path. A PDP15 routine reads the pen position at a regular rate and the resulting set of points (called a path curve or p-curve to use the terminology of GENESYS(7)) is stored in a SPROGS file. The file is then used to control the movement of an object.
If the file is displayed as a graph with a spot at each sampling point, a cluster of points indicates a slow speed and speeded up motion is shown by an increasing speed. This file can be edited which of course effects the whole sequence.
We can control one parameter at a time, simply by sampling one coordinate only. This file is displayed as a graph with time as the horizontal axis. The file can then be used to control the change of some argument to a routine, as in the example TWOLINES of section 7. This routine need not specify position; it could control the panning of a notional camera (by changing a region position) at a rate controlled by the parameter file. A controlled zoom can be produced just as easily.
The animator will be able to specify a time-dependent selection of versions of a picture (or cel-class). For instance, if the film shows the front view of a house and a window opens, one may want to obtain the effect of 3-D by drawing, say 4, positions of WINDOW. The window we suppose has divisions which make it obvious that it is moving. When he wants to produce a sequence, he can build an integer file (a 'selection description') like:-
1,1,1,1,.........,1,2,2,3,3,4,4,...... .4
name it 'INT' and use it thus:-
make index variable 9 point to first member of 'INT' NUMBR(AR(9)) <--- DRAW('MILL') | update 9 | REPEAT -------
Implementation of the basic PDP15 system will not be hard since most of the syntax is already in the main part of SPROGS; the contents of sections 6 - 8 provide the mechanism for most of the facilities described in this section.
This paper outlines some of the facilities of SPROGS which we feel are particularly useful for computer animation. We have concentrated on a few basic ideas and dealt with only the low-level routines of the system for simplicity even though more elegant syntactic constructs exist. We intend to provide a preprocessor so that the written SPROGS program is not lost in confusion among Fortran subroutine calls. This is particularly necessary for the routines associated with index variables. The current state of the project is that the system is defined and 4 people are involved in the implementation.