CG Unit 6 Animation and Gaming
CG Unit 6 Animation and Gaming
Unit 6
CREATE SEGMENT(ID)
SEGMENT-SIZE[SEGMENT-NAME] <- 0;
END;
It is important to note that at any time, only one segment can be open, thus a
series of function calls such as:
CREATE SEGMENT(1)
output primitives
3. Key-frame specifications:
• A keyframe is a detailed drawing of the scene at a certain time in the
animation sequence.
• Within each key frame, each object is positioned according to the
time for that frame.
• Some key frames are chosen at extreme positions in the action; others
are spaced so that the time interval between key frames is not to great.
4. Generation of in-between frames:
• In-between frames are the intermediate frames between the key
frames.
• The number of in-between frames is based on the media to be used to
display the animation. In common, film needs twenty-four frames per
second, and graphic terminals are refreshed on the rate of 30 to 60
frames per second.
• Classically, there are three to five in-between frames for each pair of
keyframes.
• E.g. We want to design an animation sequence for 10 seconds. For
this we need to have 24x10 frames because film requires 24 frames
per second. Out of these 240 frames, we can have 48 keyframes and
remaining 192 in-between frames. In this case there are 4 in-between
frames between two keyframes.
Animation languages
There are many different languages for describing computer animation
and new ones are constantly being developed.
Animation languages can be categorized as:
1) Linear-list notations
2) General purpose languages
3) Graphical languages
1) Linear-list notations:
2) Parameterized systems:
These languages specifies the object motion characteristics to be as a part of
the object definitions.
So the designer can have control over object's characteristics such as degree
of freedom, motion limitation and allowable shape changes.
3) Scripting systems:
This language allows object specifications and animation sequences to be
defined in a user-input script.
It is possible to write a script for defining object and its motion.
Such a scripts can be stored in the library.
Morphing
Morphing is transformation of object shape from one form to another
Morphing is common in entertainment industry. Morphing is widely used
in movies, animation, games etc.
Morphing is the process in which the source image is gradually distorted
and vanished while producing the target image.
• The earlier images in the sequence are similar to source image and
last images are similar to target image.
• Middle image of the sequence is the average of the source image
and the target image.
When an object is described using polygon, we compare the two keyframes
for which in-between frames are to be generated.
The keyframes are compared in terms of number of vertices and number of
edges . If they are unequal, they are added or deleted to match the count as a
preprocessing steps.
This is shown in following example:
There are 2 keyframes, K and K+1.
The frame K has one line segment while frame K+1 has two line segments.
As keyframe K+1 has an extra vertex, we add a vertex between vertices 1
and 2 in keyframe K to balance the number of vertices in two frames as a
preprocessing step.
Then using linear interpolation, we translate the added vertex in keyframe K
into vertex 3' along the straight line path.
So the intermediate position of this 3' gives us the in-between frames.
Following figure shows transformation of triangle into quadrilateral using
linear interpolation:
Equalize two keyframes
Tweening
The animator draws objects and characters either by hand or with a
computer.
Then he positions his creations in key frames, which form an outline of the
most important movements.
Next, the computer uses mathematical algorithms to fill in the "in-between"
frames. This process is called tweening.
Key framing and tweening are traditional animation techniques that can be
done by hand, but are accomplished much faster with a computer.
Motion specification
There are following common ways in which the motions of objects
can be specified:
Direct motion specification
Goal-directed systems
Kinematics and Dynamics
Direct motion specification:
It is most straight forward method for defining a motion sequence.
In this method, the rotation angles and the translation vectors are specified so
that geometrical transformations can be applied to the objects in the scene to
generate animation sequences.
Goal-directed systems:
In these systems, instead of specifying motion parameters, goal specific
instructions are specified.
For example: We would specify that we want an object to walk or to run to a
particular destination.
Kinematics and Dynamics:
1) Kinematic descriptions:
Motion parameters such as position, velocity and acceleration are specified
without reference to the forces that causes the motion to generate animation
sequences.
Inverse Kinematics: In this approach, initial and final positions of objects
are specified and from that motion parameters are computed by system to
generate animation sequences.
2) Dynamic descriptions:
The forces that produce the velocities and accelerations are specified. Such
descriptions of objects are referred as a physically based modeling.
Here, object motions are obtained from the force equations describing
physical laws, such as Newton's laws of motion for gravitational and friction
forces, Euler or Navier-stokes equations describing fluid flow and Maxwell's
equations for electromagnetic forces.