To create the illusion of movement an image is created on the computer screen then quickly replaced by a new image that is similar to the previous image, but shifted slightly.
A simple example:
The screen is blanked, then a filled red circle is drawn in the centre of the screen. Next the screen is blanked, but the red circle is drawn slightly to the right of its original position. This process is repeated, each time moving the circle a bit to the right. If this process is repeated fast enough the red circle will appear to move smoothly to the right. This basic procedure is used for all moving pictures in films and television.
To trick the eye and brain into thinking it is watching a smoothly moving object the pictures must be drawn at about 30 frames a second, or faster. (A frame is one complete image.) Above 70 frames a second no improvement in perceived realism is gained with faster speeds. Below about 30 frames per second most people can detect the flicker associated with the drawing of new images which detracts from the illusion of realistic movement. Above 70 frames per second no improvement is seen due to the way the eye and brain process images. The reason no flicker is seen at higher speeds is due to “persistence of vision”. The eye and brain working together actually momentarily store whatever you look at for a fraction of a second, and automatically smooth out minor jumps.
In 2D computer animation moving objects are often referred to as “sprites”. A sprite is a small image that has a location associated with it. The location of the sprite is changed slightly each fame then displayed to make the sprit appear to move. The following pseudo code makes a sprite move from left to right;
Int x, y; X = 0; Y = SCREEN_HEIGHT / 2; While ( x < SCREEN_WIDTH ) DrawBackGround(); DrawSpriteAtXY(X, Y); // draw on top of the background X=X+5; // move to the left End_while
Modern (2001) computer animation uses sophisticated math to manipulate complex three dimensional polygons, apply “textures”, lighting and other affects to the polygons, and finally rendering the complete image. Lets step through rendering (render: create one complete frame on the computer screen) a simple image of a room with flat wood walls with a grey pyramid in the centre of the room with a spot light shining on it. Each wall, the floor and ceiling is a simple polygon, in this case a rectangle. Each corner of the rectangles is defined by three values: x, y and Z. X is how far left and right the point is. Y is how far up and down the point is, and Z is far in and out of the screen the point is. The wall nearest us would be defined by four points: (in the order x, y, z)
(0, 10, 0) (10, 10, 0) (0,0,0) (10, 0, 0) The far wall would be: (0, 10, 20) (10, 10, 20) (0,0, 20) (10, 0, 20)
This short article has only introduced the most basic elements of modern computer animation.