Department of nskinfo i-education www.nskinfo.com && www.nsksofttech.com CS2401- Computer Graphics Computer Animation Department of nskinfo i-education
Learning Objectives Raster Methods for Computer Animation Design of Animation Sequences Traditional Animation Techniques General Computer-Animation Functions Key-Frame Systems Morphing Simulating Accelerations Motion Specification Articulated Figure Animation Periodic Motions Animation in OpenGL
Computer Animation Any time sequence of visual changes in a picture
Computer Animation Real-time animation Frame-by-frame animation Each stage of the sequence is viewed as it is created Useful in simulators Frame-by-frame animation Each frame of the motion is separately generated and stored Used for movies
Raster Methods for Computer Animation Double buffering: while the screen is being refreshed from one buffer, we construct the scene in the other buffer Raster operations Block transfers of rectangular arrays of pixel values Often used in games
Design of Animation Sequences Storyboard layout Rough sketches A list of basic ideas for the action Object definitions Each participant in the action Basic shapes Movements to be performed by each character and object Key-frame specifications Detailed drawing of the scene at a certain time in the animation sequence Generation of in-between frames Intermediate frames between the key frames
Traditional Animation Techniques Squash and stretch To simulate acceleration
Traditional Animation Techniques Timing Slow objects are simulated with more frames, while faster moving objects are displayed with fewer frames
Traditional Animation Techniques Emphasizing object movements Anticipation of coming motion – a cartoon character can lean forward before running Follow-through actions – a hat can fly off a character that is stopped abruptly Staging – focusing on an important part of a scene
General Computer-Animation Functions Managing object motions Generating views of objects Producing camera motions Generating in-between frames
Key-Frame Systems Generate in-between frames from the user-specified key frames (two or more) Complex scenes separated into individual components called cels
Morphing Transformation of object shapes from one to another
Morphing Transforming a line segment added point key frame k halfway frame key frame k+1
Morphing Transforming a triangle into a quadrilateral added point key frame k halfway frame key frame k+1
Motion Specification Direct specification of geometric transformation (transformation matrix) Equation of the path Bouncing ball:
Articulated Figure Animation Articulated figure: hierarchical structure composed of a set of rigid links that are connected at rotary joints Basic technique for animating people and animals
Periodic Motions Have to be sampled frequently enough (Nyquist frequency)
Animation in OpenGL Double buffering: glutInitDisplayMode(GLUT_DOUBLE); Swapping buffers: glutSwapBuffers(); Continuous animation: glutIdleFunc(animationFcn);
Example prog13OGLAnimation.cpp