Introduction to Basic Principles of Animation

Keyword: 
Principles of Animation

          The term computer animation generally refers to any time sequence of visual changes in a scene. In addition to changing object position with translations or rotations, a computer-generated animation could display time variations in object size, colour, transparency, or surface texture. Animation is the rapid display of a sequence of images of 2-D artwork or model positions in order to create an illusion of movement.


About Author

This tutorial is submitted by Sajith and Mahesh , 2007 Computer Science
Pass out  from  TocH Institute Science and Technology -Arakkunnam
Ernakulam

it is an optical illusion of motion due to the phenomenon of persistence of vision.


These are the necessary key frames needed to create a bouncing ball animation.To create the illusion of movement, an image is displayed on the computer screen then quickly replaced by a new image that is similar to the previous image, but shifted slightly. This technique is identical to how the illusion of movement is achieved with television and motion pictures

 For example the screen is blanked to a background colour, such as black. Then a ball is drawn on the right of the screen. Next the screen is blanked, but the ball is re-drawn or duplicated slightly upwards to its original position. This process is repeated, each time moving the ball a bit upward. If this process is repeated fast enough the ball will appear to move smoothly in upwards direction. This basic procedure is used for all moving pictures in films and television.


 Button Design

 The buttons are implemented by drawing a rectangle with two adjacent pairs of edges in two different colours. In normal mode (unclick state) two lines of lighter shade on the top and left of a rectangle are drawn and darker shades are used on the remaining two sides. When in pressed state the colours of the (top & left) lines and (bottom & right) lines are interchanged so as to get a pressed effect.
                                                            

Initial state                  when a button is pressed

                                  
Mouse Operations

            The mouse operations are implemented using assembly language statements. The mouse is initialized using moving 00h into AH register and calling the DOS interrupt int 33h. This command resets the mouse.  Using this function we determine if mouse support is present.  It performs a hardware and software reset.

  For text-mode applications, this function does the following:

Ø      Moves the mouse pointer to the centre of the screen

Ø      Hides the pointer (use INT 33H 0001H to display it).

Ø      Clears any "exclusion area" set via INT 33H 0010H.

Ø      Sets the pointer mask to the default: inverse-attribute of character at pointer.

Ø      Sets the range to the height and width of the entire screen

Ø      Sets up for pointer drawing on video page 0

Ø      Sets pointer speed ratio to horizontal: 8 to 8; vertical 8 to 16 and sets the maximum doubling threshold to 64 mickeys

Show Mouse Pointer

This unhides the mouse pointer.  It actually increments an internal counter used by the mouse support to determine when to show the pointer. That counter starts as -1. This call increments it to 0. Whenever the counter is 0, the mouse pointer is displayed and tracked on-screen.  When the counter is 0, subsequent Show Pointer calls are ignored.  Calls to INT 33H 0002H (hide pointer) decrements the counter. This logic relieves programs of the burden of global tracking of the hidden/displayed state.  A subroutine may always use INT 33H 0001H at the beginning and INT 33H 0002H at the end, without affecting the shown/hidden state of the calling routine. This function also resets the "exclusion area" set via        INT 33H 0010H.

Hide Mouse Pointer

This removes the mouse pointer from the screen (if it is currently visible).  It actually decrements an internal pointer-display cursor.  If that counter is 0 before the call, the mouse pointer is removed from the screen.Use this function before performing any direct writes to the video display (if doing so will overwrite the mouse pointer) and call INT 33H 0001H (show ptr) after writing to the screen


Mouse Status

This returns the current position of the mouse pointer, and the current status of the mouse buttons. Rather than constantly polling this function, one can install a mouse event handler via INT 33H 000cH or INT 33H 0018H and maintain global variables for instant access to mouse information. All X, Y coordinates are virtual coordinates and when working with text mode, you must divide each value by 8 to get a character clm (column), row.


Query Button Press

This instruction returns the current button status. The number of times the specified button (in BX) has been pressed since the last call to this function. The X,Y coordinates of the pointer at the time of the most recent press of that button, check for the press of a particular button (e.g., if the right- button means to cancel).


Query Button Release

This instruction returns the current button status. The number of times the specified button (in BX) has been released since the last call to this function.            The X, Y coordinates of the pointer at the time of the most recent release of that button.

 

Video Operations

       Since the project does not use any predefined header files the initialization and drawing operations are done using embedded assembly code


Video Initialization

This is performed by moving 00H into the AH register and passing the video mode number (optionally, +80H for don’t clear data) into AL register. This initializes the video hardware to display in the specified video mode.

        Put Pixel

          The BIOS does not support line-drawing or other standard graphics primitives. When you add 80H to the color value in AL, the specified color is XORed with the color that is currently at that position.  That is a useful graphics operation since XORing the same value twice ends up with the original value.

Get Pixel

This obtains the color value of the dot at the specified graphics screen location.


Related Articles


Bookmark / Share


Most Visited Contents

Jobs for BE, Btech, Mtech, Msc, MCA, Bca, Bsc , Bcom & Other Professionals  .Jobs in Kerala - Job Vacancies in Techno Park -Trivandrum Jobs  Job Vacancies in Info Park - Jobs in Cochin - Kerala IT JobsJobs in Koratty Info park - Jobs in Thrissur - Koratty Info Park Job Vacancies

Syndicate content