Animation

It is known that videos consist of a large number of images, which are displayed fast enough one after the other, with successive images differing only slightly. Creating videos in this way is essentially possible because a person (human being), at a sufficiently high speed of rendering images, is not able to see individual images, but rather they blend together and create an impression of movement.

Creating a motion impression with still images is called animation. For example, from the following eight pictures of a character in different positions:

../_images/pganim_running1.png ../_images/pganim_running2.png ../_images/pganim_running3.png ../_images/pganim_running4.png ../_images/pganim_running5.png ../_images/pganim_running6.png ../_images/pganim_running7.png ../_images/pganim_running8.png

the following animation of running is created:

../_images/pganim_running.gif

Each of the images that appear in an animation is called a frame. The programs we have been working on so far were drawing only one drawing (frame) and the image was not changed after that. In programs that use animation one image must be drawn for each frame. In the following lessons we will see how we can do that.