u8-cg - Computer Graphics Computer Animation Computer...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Computer Graphics Computer Animation Computer animation 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, color, transparency or surface texture. Advertising animations often transition one object shape into other (morphing). Computer animations can also be generated by changing camera parameters, such as position, orientation, and focal length. We can produce computer animations by changing lighting affects or other parameters and procedures associated with illumination and rendering. Design of animation sequences In general, an animation sequence is designed with the following steps Storyboard layout Object definitions Key-frame specifications Generation of in-between frames Storyboard layout The storyboard is an outline of action. It defines the motion sequence as a set of basic events that are to take place. Depending on the type of animation to be produced, the storyboard should consist of a set of rough sketches or it could be a list of basic ideas for the motion. Object definitions An object definition is given for each participant in the action. Objects can be defined in terms of basic shapes, such as polygons or splines. In addition, the associated movements for each object are specified along with the shape. Key-frame specifications A key-frame 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 too great. More key-frames are specified for intricate motions than for simple, slowly varying motions. Generation of in-between frames In-betweens are the intermediate frames between key-frames. The number of in-betweens needed is determined by the media to be used to display animation. Film requires 24 frames per second, and graphics terminals are refreshed at the rate of 30 to 60 frames per second. Typically, time intervals for the motion are set up so that there are from three to five in-betweens for each pair of key-frames. Depending on the speed specified for the motion, some key frames can be duplicated. For a one minute film sequence with no duplication, we would need 1440 frames. With five in-betweens for each pair of key-frames, we would need 288 key frames. General computer-animated functions Animation packages, such as wave-front , for example, provide special functions for designing the animation and processing individual objects. One function available in animation packages is to store and manage the object database. Object shapes and associated parameters are stored and updated in the database. Other object functions include those for motion generation and those for object rendering. Contd., Motions can be generated according to specified constraints using 2-D or 3-D transformations. Standard functions can then be applied to identify visible surfaces and apply the rendering algorithms. Another typical function simulates camera movements. Standard motions are zooming, panning, and tilting. Finally, given the specifications for the key frames, the in-betweens can be automatically generated. Raster animations On raster systems, we can generate real-time animation in limited applications using raster operations. A simple method for translation in the xy plane is to transfer a rectangular block of pixel values from one location to another. Two-dimensional rotations in multiple of 90 0 are also simple to perform, although we can rotate rectangular blocks of pixels through arbitrary angles using anti-aliasing procedures. To rotate a block of pixels, we need to determine the percent of area coverage for those pixels that overlap the rotated block.. Contd., Sequences of raster operations can be executed to produce realtime animation of either 2-D or 3-D objects, as long as we restrict the animation to motions in the projection plane. We can also animate objects along two-dimensional motion paths using color-table transformations. Here, we predefine the object at successive positions along the motion path, and set the successive blocks of pixel values to colortable entries. We set the pixels at the first position of the object to `on' values, and we set the pixels at the other object positions to the background color. Contd., The animation is then accomplished by changing the color-table values so that the object is `on' position at successive positions along the animation path as the preceding position is set to the background intensity. Computer-animation languages Design and control of animation sequences are handled with a set of animation routines. A general purpose language, such as C, Lisp, Pascal or FORTRAN, is used to program the animation functions, but several specialized animation languages have been developed. Animation functions include a graphics editor, a key-frame generator, an in-between generator, and standards graphics routines. The graphics editor allows us to design and modify object shapes, using spline surfaces, constructive solid geometry methods, or other representation schemes. Key-frame systems Key-frame systems are specialized animation languages designed simply to generate the in-betweens from the user specified keyframes. Usually, each object in the scene is defined as a set of rigid bodies connected at the joints and with a limited number of degrees of freedom. For example, A single arm robot has six degrees of freedom. Parameterized systems Parameterized systems allow object-motion characteristics to be specified as part of the object definitions. The adjustable parameters control such object characteristics as degrees of freedom, motion limitations, and allowable shape changes. Scripting systems Scripting systems allow object specifications and animation sequences to be defined with a user-input script. From the script, a library of various objects and motions can be constructed. Morphing Transformation of object shapes from one form to another is called `morphing'. Given two frames for an object transformation, we first adjust the object specifications in one of the frames so that the number of polygon edges (or the vertices) is the same for the two frames. This preprocessing step is illustrated in the figure shown below. 1 2 key-frame k 1 2 Key-frame k+1 3 Morphing (Contd.,) A straight line segment in key frame k is transformed into two line segments in key frame k+1. Since key frame k+1 has an extra vertex, we add a vertex between vertices 1 and 2 in key frame k to balance the number of vertices (and edges) in the two key frames. Using the linear interpolation to generate the in-betweens, we transition the added vertex in key frame k into vertex 3 along the straight line path shown in the figure given below. 1 1 3 2 Key frame k Added point Half-way frame 2 Key frame k+1 Morphing (Contd.,) We can state general preprocessing rules for equalizing key frames in terms of either the number of edges or the number of vertices to be added to a key frame. Suppose we equalize the edge count, and parameters Lk and Lk+1 denote the number of line segments in two consecutive frames. we then define Lmax = max (Lk , Lk+1 ) , Lmin = min (Lk , Lk+1 ) , Ne = Lmax mod Lmin and Ns = int (Lmax Lmin) then the preprocessing is accomplished by Morphing (Contd., ) 1. dividing Ne edges of key-framemin in to Ns + 1 sections. 2. dividing the remaining lines of key-framemin in to Ns sections. As an example, if Lk = 15 and Lk+1 = 11, we would divide 4 lines of key frame `k+1' in to two sections each. The remaining lines of key frame `k+1' are left intact. As another example, if Lk = 11 and Lk+1 = 49, Then Ne = 49 mod 11 = 5 and Ns = int (49/11) = 4 we would divide 5 lines of key frame `k' in to 5 sections each. The remaining 6 lines of key frame `k' into 4 sections each. If we equalize the vertex count, we can use parameters Vk anf Vk+1 to denote the number of vertices in the two consecutive frames. In this case, we define Vmax = max (Vk , Vk+1 ) , Vmin = min (vk , Vk+1 ) , Nls = (vmax -1) mod (Vmin -1) Np = int { (vmax -1) (Vmin -1)} and Morphing (Contd.,) Preprocessing using vertex count is performed by 1. adding Np points to Nls line sections of key-framemin 2. adding Np-1 points to the remaining edges of key-framemin For the triangle - to - quadrilateral example, Vk = 3 and Vk+1 = 4. Both Nls and Np are 1, So we would add one point to one edge of key frame k. No points are added to the remaining lines of key frame k+1. Simulating accelerations To simulate accelerations, we can adjust the time spacing for the inbetweens. For constant speed (zero acceleration), we use equal interval time spacing for the in-betweens. Suppose we want n in-betweens for key frames at times t1 and t2. t1 t t2 The time interval between key frames is then divided into n+1 sub intervals, yielding an in-between spacing of t = t 2 t1 n+1 Contd., We can calculate the time for any in-between as tBj = t1 + j ( t) , j = 1, 2, ... , n and determine the values for coordinate positions, color and other physical parameters. Nonzero accelerations are used to produce displays of speed changes, particularly at the beginning and end of a motion sequence. To model increasing speed (positive acceleration), we want the time spacing between frames to increase so that greater changes in position occur as the object moves faster. Contd., We can obtain an increasing interval size with the function 1 cos , 0 < < / 2 For n in-betweens, the time for the j th in-between would then be calculated as tBj = t1 + ( t) . 1 cos j , j = 1, 2, ... , n 2(n+1) Where t is the time difference between the two key frames. we can model decreasing speed (deceleration) with sin in the range 0 < < / 2. The time position of an in between is now defined as Contd., j , j = 1, 2, ... , n 2(n+1) Often motions contain both speed-ups and slow-downs. We can model a combination of increasing-decreasing speed by first increasing the time spacing, then we decrease this spacing. A function to accomplish these changes is 1 cos , 0 < < / 2 2 The time for the j th in-between is now calculated as tBj = t1 + ( t) . 2 1 cos j (n+1) , j = 1, 2, ... , n tBj = t1 + ( t) . sin Motion specifications Direct motion specification The most straight forward method for defining a motion sequence is direct specification of motion parameters. Here, we explicitly give the rotation angles and translation vectors. Then the geometric transformation matrices are applied to transform coordinate positions. Alternately, we can use an approximating equation to specify certain kinds of motion. Contd., For example, We can approximate the path of a bouncing ball, for instance, with a damped, rectified, sine curve: y(x) = A | sin (x +0) | e-kx . Where A is the initial amplitude, is the angular frequency, 0 is the phase angle, and k is the damping constant. Contd., Goal directed systems At the opposite extreme, we can specify motions that are to take place in general terms that abstractly describe the actions. These systems are referred to as goal directed because they determine specific motion parameters, given the goals of the motion. For example, we could specify that we want an object to walk or to run to a particular destination. The input directives are then interpreted in terms of component motions that will accomplish the selected task. Motion specifications (contd.,) Human motions, for instance, can be defined as a hierarchical structure of sub motions for the torso, limbs, and so forth. Kinematics and Dynamics We can also construct animation sequences using kinematic or dynamic descriptions. Kinematic motion descriptions specify positions, velocities, and accelerations Dynamic motion descriptions are given in terms of the forces acting on the objects in a scene. ...
View Full Document

This note was uploaded on 02/23/2012 for the course CS 101 taught by Professor Martand during the Spring '10 term at Punjab Engineering College.

Ask a homework question - tutors are online