CAMP - computer assisted movie production

J Citron, IBM and John H Whitney, Pacific Palisades

1968

AFIPS FJCC

INTRODUCTION

In designing a language for computer assisted production of animated film sequences, a serious attempt has been made to avoid dependence upon the user's knowledge of mathematics, geometry, and programming logic. Such a user can be expected to have the sense and sensitivity of an artist in manipulating given geometric figures, so our first objective is to provide a general way to construct a wide variety of figures and then to provide manipulative functions for their spatial and temporal evolution. While the mathematical and logical program necessary to perform this processing may be complex, the language seen by the user must afford control over all the technical flexibility available in the program, but from the user's non-technical standpoint.

The approach we have taken is to minimize the number of types of statements in the language - basically there are three - and introduce numerous fundamental concepts which may be learned by experience with the aid of an interactive program.

Various approaches to hardware are possible, and so the language only depends on the ability of the computer to address a display device. If a cathode ray tube is used, a camera should also be attached under full control of the computer.

Our implementation consists of a program written in the GRAF language to run on the IBM 360 with a 2250 display unit equipped with a program function keyboard. Mr. D. Bottles of the IBM Los Angeles Scientific Center has constructed a control box which connects to the function keyboard and a camera constructed by Mr. Whitney. This device allows the light circuits on the keyboard to activate the camera controls under computer direction to photograph images on the 2250 and advance the film frame, and also uses the key circuits as feedback sensors to advise the computer of the camera's status with regard to these controls.

Development was carried out at the Health Sciences Computing Facility of the Medical School, University of Californis at Los Angeles.

Technical background

The list of figures which one would like to be able to generate is practically endless. Thus, a direct geometrical approach suggests an infinity of subroutines which can be singled out according to the figure classification requested. An alternate viewpoint would be to consider any desired patterns to consist of curve segments of limited size (they must fit on a film frame) and then attack the problem of creating generalized curve segments. This decreases the required number of figure generation routines tremendously and, in fact, a single routine can be devised in different ways which will prove quite adequate for constructing just about any desired pattern within the given hardware limitations.

The curve equation and its parameters

Behind the scenes, so to speak, of our program lies a single mathematical function embedded in an algorithm with a number of parametric controls. This function may be expressed as the polar equation:

R= A(sinBθ)P 

Two points are specified in a 2-dimensional Cartesian frame by four parameters-(X,Y) and (U,V) to define the lower left-hand and upper right-hand corners of the computed picture. Theoretically, assignment of values to A, B, and P then produces the curve R(θ) which may or may not lie within the frame defined above. However, because of the nature of current display hardware, the values taken on by the variable θ must be enumerated in a discontinuous fashion so that if the discrete points (R,θ) are to be connected, they will be joined by straight lines. Fortunately, this provides many advantages and few, if any, handicaps since the eye cannot detect the discontinuous nature of the curvature of a segment whose points lie reasonably close together. This introduces the need for four more parameters. S and T are the first and last values taken on by θ. N is the number of intervals into which the range T-S will be divided. The connectivity of the points marking the intervals is given by the parameter, J. If J equals 0, only points are displayed while the internal ordering of the points is the same as for J equals 1. For J not equal to 0, 0 runs from S to T in N steps but ordered by skipping J points ahead and cycling in the given range. If J and N have a common submultiple, fewer than N points are used.

The use of the parameters A and B is clear from the equation, but the exponent, P, requires further clarification. If P were restricted to integer values (which it is not), the odd and even integers would govern two different regimes of (R,θ). Even values for P would cause all R values to have the same sign as A, regardless of the sign of (sin Bθ), whereas odd P values would give R the sign of the product of the signs of A and (sin Bθ)P. Further, negative values for P destroy the main attribute of the sine function-its boundedness! Our algorithm makes available both the odd and even integer regimes in a continuous way for all real values of P (not just integers) and avoids the negative P problem by using the sign of P to specify the regime. Negative P assigns the sign of A sin Bθ to A abs(sin Bθ)abs(P) while positive P mimics the even integers. P set to zero causes R to equal A for all values of θ.

.

The algorithm uses two additional parameters for remapping the (R,θ) points to (R,φ). A rotation, Q, is added to all θ values and the interval containing the rotated points (S+Q to T+Q) is stretched (or shrunk) linearly by a factor, W, so that the points run from S+Q to WT+Q in units of J(TW-S)/N. If W is equal to zero, the program uses the original interval (S+Q to T+Q).

Now, given the point (R,θ), one would expect its Cartesian coordinates to be expressed by (x,y) where:

x = R cos φ
y = R sin φ

However, we have added three additional pairs of parameters to allow individual x and/or y translations and scalings:

x = C + ER (cos φ)H
y = D + FR (sin φ)Z

where the signs of H and Z are handled like the sign of P. Finally, a rotation with respect to the center of the film frame is specified by the parameter O.

In all then, there are 20 parameters which may be used to define a single curve. We refer to each set of 20 parameters as a curve so that a number of curves may make up a single figure. Default values are predefined for the parameters so that only distorted parameters need to be specified for any curve.

Options connecting curves

Beside the ability to control multiple exposures, there are three options which provide a manifold of techniques for combining curves. We refer to these as the add, link, and concatenate options and use the symbols +, -, and | to represent them in equations. Further, we label the polar coordinates of the computed points with a curve index, c, and a point ordering index, i, which runs from 1 to n(c). Thus ( R(24), φ(24) ) represents the fourth point in the second curve. We are now in a position to describe the curve combining options in a precise way.

If curves (1) and (2) are added in that order

i. e. (1) + (2) 

the computed points have coordinates

( R(1i) + R(2i), φ(2i) )

while (2) + (1) results in plotting the points:

( R(1i) + R(2i), φ(1i) )

Thus we see that the add option is not commutative but results in using the angular coordinates of the last curve specified. Of course, if the two curves have the same number of points and the same range of θ and identical point ordering (that is identical values for N, J, S, T, and W) as well as the same frame scaling parameters, this operation is equivalent to a direct algebraic addition of the two curves and their apparent order is immaterial.

Linking two curves causes points with the same ordering index to be connected by straight lines. Thus (1) - (2) results in a pattern of lines connecting points R(1i), φ(1i) ) to points R(2i), φ(2i) ) with connections between points having identical i indices. One of the many uses of this option is to connect two curves which are identical in all respects except for position on the frame and possibly size thus providing 3-D wire frame perspectives.

Concatenation of curves orders their points in a sequential manner for treatment as a single curve in subsequent add or link operations. That is, (1) | (2) effectively produces a single curve whose point indices run

(11), (12),..., (1n(1)),(21), (22),..., (2n(2)),

giving a total of n(1) + n(2) ordered points.

Two special counters affect the option algebra strongly. One marks the point at which the last concatenation started and the other marks the beginning of the previous link. Add is carried out starting at the position of the concatenation counter so that

1 + 2 | 3 + 4 implies (1 + 2)|(3 + 4). 

Concatenate uses the last point of the last curve as a starting point so that, in the above example, the final result depends on the relative lengths of the point strings 1 and 2. If there are fewer points in curve l than in curve 2 (or if the number of points is equal in both), the figures contain all computed points. But if curve 1 has more points than curve 2, there is a resultant loss of some points. This is most clearly seen graphically:

ordered points of curve 1 points of curve 2 1 plus 2 tail of 1 points of 3 4 3 + 4 tail 4 1 + 2 3 + 4 tail 4 **RESULT**

Note that the points of curve 1 which overlapped in the add operation with curve 2 are simly lost in the result. This could be avoided if desired by specifying 2+1|3+4.

Link is always carried out from the beginning of the previous link, providing there was one. Thus 1-2+3|4-5 is expressed logically as 1-[(2 + 3)|4]-5 where the three curves in the brackets are treated as a single string of points for the two link operations.

It should now be clear that the three options provide much flexibility over and above that afforded by the 20 parameters per curve.

Temporal control

So far, our definition of a curve seems fairly straightforward because of the assumed static nature of the parameters. However, two different systems for control of the time rate of change of each parameter are available in the program algorithm. Thus a curve can be an extremely complex function of time and may appear on a film frame to be identical to some other curve at one or a few separate instants of time. This ability requires that at least one and possibly even all twenty parameters be specified by more than just a single numerical value. Each parameter now consists of a list of up to 16 items, and the interpretation of these list entries depends on which temporal control system is in effect.

For the type 1 rate controls, the list contains three kinds of entrics values, rates, and relative times grouped in that order. The use of relative times allows a curve to evolve in a given manner during the time spanning any number of frames. Such evolution may occur in separate sequences or overlapped in the same sequence.

To explain the rate entries, we'll call V, the initial value of the parameter at time t1 and V2 the value to be reached at time t2. The value V at any intermediate time T is computed according to the rate entry in the list. If the rate is zero, the parameter goes from V1 to V2 linearly in time - that is:

V = ((T - t1) / (t2 - t1) ) (V2 - V1) + V1

If the rate is a positive number, r, an acceleration is made so that the value of the parameter at any time other than t1 or t2 is less than the linearly computed value. The equation used is:

V = [(T - t1) / (t2 - t1) ]1+r (V2 - V1) + V1

To obtain a deceleration, a negative rate is used. In this case, in order to provide temporal symmetry with the accelerating rate path, the required equation turns out to be:

V = [1 - [(t2 - T) / (t2 - t1) ]1+|r| ] (V2 - V1) + V1

The symmetry mentioned is most easily seen geometrically:

T1-t1 = t2-T2 in the figure. At T1, the difference between the linear value and the decelerating value is d. At T2, the accelerating path is the same distance from the linear one. Thus, temporal segments can be pieced together so as to match velocities as well as values at their connecting point.

The type 2 temporal controls are quite different in appearance. Actually, one can set up the same motions in either system, but it may well prove very tedious to acquire certain results by one method and relatively simple by the other. Under type 2 control, a parameter obeys the equation:

V = (Vm - V0)(sin T)p + V0 

where T runs from Ti to Tj and the sign of the exponent p is used just as for P, H, and Z to affect the shape of the oscillation. For this kind of control then, the list of items characterizing each parameter must contain values, phases, exponential rates, and relative times.

Learning the fundamentals

Static use of the parameters and options is learned with the assistance of a separate program. This code displays on the 2250 a list of the twenty parameters equated to their default values. Along with the parameters there are also displayed a numeric keyboard and the word GO. Touching a parameter with the light pen causes its value to be erased. Then as keyboard entries are touched, those particular digits appear consecutively setting up the new value for the parameter. When GO is touched, the entire menu is erased, and the curve specified by the parameters appears along with a list of return options. Besides the add, link, and concatenate options, there are ERASE. CLEAR and KEEP. Touching the erase option erases the curve and returns the parameter menu with all the previously set values still intact. Touching CLEAR removes the curve from the display, and also from the computer's memory. The default value again appear on the menu. KEEP functions in the same way as ERASE except that, ater setting up a new curve and touching GO, that new curve is displayed along with the kept ones.

Parameter menu - Default values are right justified in Fortran I3 format. Values entered with the light pen build from left to right, digit by digit. In the paper, the parameter, R, has been called Z to avoid confusion with R in the basic equation.

This program can be used to develop an intuitive feeling for the parameters and options as well as to study seriously the analytic geometry of the fundamental equation. It is also most useful to the experienced user for determining experimentally how to construct any desired figures and then transcribing that construction knowledge directly into the animation program language. The animation program itself may also be used in a dry run mode for testing and debugging time sequences.

The language

As soon as one feels he has some grasp of the options and a few of the parameters, he is ready to learn the format of the data cards which comprise the language for the animation program. The three types of cards are referred to as identification statements, parameter statements, and frame statements. For one time sequence, a curve is specified by one identification statement and as many parameter statements as needed. Up to ten curves can be defined in one time sequence in the present program. After all curve specification cards, the frame statements are entered for the sequence. Other sequences may follow these directly.

The identification statement

An identification card contains the letters ID in columns 1 and 2. From that point on, the field positions are not rigidly defined except for two rules:

  1. from one to four spaces may separate fields
  2. anything following a 5-space gap will be treated as a comment

The first numeric field is a curve identification number from 1 to 10. The remaining fields are optional. As many as will fit on a card may be used to establish parameters which are to remain constant for the entire sequence at a value different than the default value. Typical identification statements are:

ID 1
ID 2 P=0 T=1.75 W=179.651
ID 3 N=251 C=-.5 F=.75 H=-3 Z=-2.566

Parameter statements

Each parameter that is to vary with time must be specified on a single card. Column 1 contans the symbol representing that parameter - X, Y, U, V, A, B, P, S, T, J, N, W, Q, O, C, D, E, F, H, or Z.

If column 2 is blank, the remainder of the card is interpreted according to the type 1 temporal control system described earlier. If any non-blank character appears in column 2, a type 2 list is assumed to follow. The same two rules regarding spaces between fields hold for the remainder of the card as was the case for identification statements.

For the type 1 parameter card, the field beginning in column 3, 4, or 5 gives the initial value of the parameter. If the rest of the card is blank, the parameter is held constant at the initial value for the entire sequence. If a slash follows the initial value, a decimal fraction representing a relative time may follow the slash. The effect here is to hold the parameter constant for that fraction of the total time of the sequence. If no slash appears, the next field contains another value toward which the parameter will approach by a type 1 rate. This rate occupies the following field and is in turn followed by a decimal fraction representing the relative time in the sequence over which the parameter must make the transition between the two values. The last group of three fields-value, rate, time-forms a typical unit of type 1 parameter card entries. Following the initial value of the parameter (the first numeric field), up to five such groups may be given. The last group (and there might only be one) leaves the time field blank implying that that group carries the parameter up to the last frame of the sequence. Any fractional time field may be followed by a slash which effectively replaces the value and rate of the next group. This causes the last value reached at the last time (before the slash) to be held constant until the new time (the field following the slash). Typical examples would be:

B 1 7 0 .25 / .5 3 1.5 
O 0 2 -1.333/ .5 4 1 .667/ 
C .5/ .5 -.5 0 

The parameter B starts at the value 1.0 and varies at a constant rate to the value 7.0 which is reached at the quarter point of the whole sequence. The value of 7 is then retained as a constant until the half way point in time. An accelerating change (rate = 1.5) is then made to the value 3.0 which occurs on the last frame. The parameter O (and all other angular parameters) has its value given in units of pi (3.1415927) radians. In the example above, 0 begins with the value 0 and changes to the value 2 (360 degrees) at a decelerating rate of -1 in one third the total time. It retains this value until one half the sequence is over and then goes through another 360 degrees (to the value 4) at an acceleration of 1 up to the 2/3 point. The slash followed by blanks then makes it stay constant to the end. C begins with the value .5 and stays that size for the first half of the sequence. It then progresses to a value of -.5 at a constant rate (rate = 0) reaching that value on the last frame.

For the type 2 time controls, recall that the equation for the parameter was written as:

V = (Vm - V0)(sin T)p + V0 
where T runs  from Ti to Tj.

On the parameter card, the field following the parameter itself (and the non-blank entry signifying type 2 control) contains the median value, V0, for the first oscillating segment. The next field is the peak value, Vm. This is followed in order by the initial and final phases, and Ti, Tjy in units of pi, the exponent, p, and the fraction of the total time, t, at which this segment ends if less than the total time for the entire sequence. Three groups of (Vm, TiT, p, t) may appear on one card (with t omitted for the final group implying the value 1 for the relative time). For groups after the first, V0 is is taken as the last value of the parameter actually calculated in the previous segment. Thus it is easy to obtain oscillating behavior of various kinds as well as continuous piecing together of up to three different oscillations for a single time sequence. An example would be the following card on which U is specified to oscillate as shown in the sketch:

A typical figure display showing the return options
U/ 2 1 0 3 2 .5 7 0 1.1 -2

Note that the first exponent, 2 is the fifth numeric field, confines the oscillation to one side of the median value and gives a zero slope at the median. The second exponent, -2 in the last field, causes an inflection point at the new value median (which happens to be the same as the old one.).

Frame statements

Following all identification and parameter cards for a sequence are the frame cards. These must be blank in the first two columns. The first two fields on each frame card contain the initial and final frame numbers for the time sequence defined by that card. The remainder of each card contains curve identification numbers and options in alternating fields with a maximum of five curves and four options per card, and up to twenty cards can describe one conglomerate sequence. For example, the cards

1  1440 1/2 + 3 
100 300 1/2 + 3 
200 1300 4 L1,2 + 3GO 

define three overlapping sequences. From frame 1 to frame 1440, the curve whose identification number is 1 evolves as specified by its parameter cards. Simultaneously, curves 2 and 3 are combined by the add option. The slash causes curve 1 to be displayed separately on the 2250. The camera photographs it, the picture is erased, but no frame advance occurs. The combined curve, 2 + 3, is computed and displayed. This picture is photographed on the same frame of film and the 2250 is agained erased. The program then checks to see if any other frame cards require an exposure for the current frame number. If such is not the case, the frame is advanced. When frame 100 is reached, the same sequence starts over as specified by the second frame card. Notice that this sequence occurs much more rapidly while the same curves are still evolving in the same relative way but in the absolute time span fixed by the first card. When 200 is reached, a third sequence begins in conjunction with the two already in progress. The third card states that curve number 4 is to be linked ("L") to curves 1 and 2 + 3 which are concatenated (comma implies concatenation on the frame cards). The GO informs the computer that this is the last frame card for the defined curves. This entire set of cards may be followed immediately by another set of identification, parameter, and frame cards for succesive sequences.

Other controls

Two data cards which the user may wish to alter contain the default parameter values and the exposure time for the camera. These can be changed at the beginning of any sequence.

Before a sequence begins, a pair of function key lights are turned on and the computer waits for a depression of one of the two corresponding keys. The key selected determines whether or not the camera will be used for the sequence. If it is not to be used, the figures are displayed as rapidly as they can be computed. If the camera is to be operative, a curve is computed and displayed, the camera is activated, the curve is erased, the next curve is computed and displayed, and so on.

The camera in use was specially made for this project. Some features were included that are not usually associated with microfilm recording systems. First, the film registration meets quality standards of the motion picture industry. Excellent frame to frame steadiness has been achieved. Second, also in conformance with motion picture procedures, the camera film magazines accepts standard 1000 ft core wound rolls of 35 mm film.

Other features of this camera are typical of microfilm systems in general. The film movement is independent of the shutter action. To advance the film one frame at a time, a Slo-Syn stepping moter is used with an attendant translator power supply for variable speed. The shutter is activated by a Ledex rotary solenoid. Switching, interface connections, and power supplies are contained in a box mounted on the camera's own floor pedestal. The interface connections to the computer include feedback circuits to detect shutter open or closed positions and to confirm film advance so that computer control is fully automatic and well supported with failsafe and sequence error detection.

Exposure tests established that an ASA 25 slow panchromatic type 5220 film was ample for good exposure density. With the camera in place before the console, an f/1.9 Baltar high resolution lens is set and locked for a fixed field so that final positioning of the camera is simply a matter of bringing a focus tape into contact with the surface of the 2250 CRT and sighting through a precision gun-sight type range finder. The camera is positioned into fine adjusted alignment with the aid of a computer generated test pattern.

The program turns on light 1 as a signal to open the camera shutter. On responding, the camera effectively depresses key 1. This is followed by an exposure timing loop in the program and subsequently light 2 is illuminated ordering the shutter to close. A successful response to this command is signalled by the apparent depression of key 2 by the camera. Programmed logic decides whether or not more information is to be displayed for this same frame of film. When the film frame is to be advanced, light 3 goes on and satisfactory response by the camera initiates the corresponding key depression.

With a working knowledge of this language, an artist can compose choreographic movements of simple or complex visual patterns and exercise control over such elements in ways never before possible. With additional darkroom techniques, he can make still further use of technological developments to add color and even sound as well as indulge in the purely human process of editing. For example, the filmed product of our program is subjected to certain optical procedures. The 35 mm black and white negative from the camera is processed normally and printed on high contrast stock yielding an image that consists of clear lines on a dense black field. This film is threaded into the projector side of an optical printer with a Bell and Howell movement and a 16 mm camera. The optical printer has several special features. The optical axis of the system is vertical with the camera looking down into the projector. The projector itself is mounted on a compound mill table. Thus additional translations and rotations of a mechanical nature may be superimposed, and the camera may be moved along the axis so as to provide for an additional scaling factor of from .1 to 10. A stepping switch circuit and preset frame counter allow a wide range of skip frame ratios to expand editing capabilities in the time domain.

At this point, we would like to present some slides showing curves drawn with the static program, blackand white moving pictures taken. directly from the 2250, and color movies with sound added which were produced using some of the optical printing methods described above.

REFERENCES

1 A Hurwitz J Citron J Yeatin GRAF Graphic additions to FORTRAN AFIPS Conference Proceedings 1967 SJCC.