Computer Graphics and image processing course. It is all about the animation functions in OpenGL.
All the functions of the raster transformation for the 2d and 3d objects are discussed
Size: 953.63 KB
Language: en
Added: Jul 02, 2024
Slides: 22 pages
Slide Content
Prof. Yogesh N, Dept. of CSD, ATMECE YN 1 Computer Graphics & Fundamentals of Image Processing - (21CS63) Course Coordinator: Prof. Yogesh N Assistant Professor Dept. of CSD ATMECE, Mysuru
Prof. Yogesh N, Dept. of CSD, ATMECE YN 2 Module 3 Interactive Input Methods and Graphical User Interfaces : Graphical Input Data ,Logical Classification of Input Devices, Input Functions for Graphical Data , Interactive Picture-Construction Techniques, Virtual-Reality Environments, OpenGL Interactive Input-Device Functions, OpenGL Menu Functions , Designing a Graphical User Interface. Computer Animation: Design of Animation Sequences, Traditional Animation Techniques, General Computer-Animation Functions, Computer-Animation Languages, Character Animation, Periodic Motions, OpenGL Animation Procedures. Textbook 1: Chapter -11, 18 Self-study topics: Raster methods for computer animation, Key frame systems, Motion specification.
Prof. Yogesh N, Dept. of CSD, ATMECE YN 3 Session 8 Computer Animation: Computer-Animation Languages Character Animation Periodic Motions OpenGL Animation Procedures
Prof. Yogesh N, Dept. of CSD, ATMECE YN 4 Computer-Animation Languages Routines can be developed to design and control animation sequences within a general-purpose programming language, such as C, C++, Lisp, or Fortran. But several specialized animation languages have been developed. Computer animation languages typically include : A graphics editor A key-frame generator An in-between generator Standard graphics routines
Prof. Yogesh N, Dept. of CSD, ATMECE YN 5 The graphics editor allows an animator to design and modify object shapes, using spline surfaces, constructive solid geometry methods, or other representation schemes . An important task in an animation specification is scene description . Scene description includes the positioning of objects and light sources, defining the photometric parameters (light-source intensities and surface illumination properties), and setting the camera parameters (position, orientation, and lens characteristics ). Another standard function is action specification . Action specification involves the layout of motion paths for the objects and camera. Usual graphics routines are needed for viewing and perspective transformations, geometric transformations to generate object movements as a function of accelerations or kinematic path specifications, visible-surface identification, and the surface-rendering operations. Computer-Animation Languages
Prof. Yogesh N, Dept. of CSD, ATMECE YN 6 Key-frame systems were originally designed as a separate set of animation routines for generating the in-betweens from the user-specified key frames. Now , these routines are often a component in a more general animation package. In the simplest case, each object in a scene is defined as a set of rigid bodies connected at the joints and with a limited number of degrees of freedom . Example : The single-armed robot in Fig. (next slide) has 6 degrees of freedom, which are referred to as arm sweep, shoulder swivel, elbow extension, pitch, yaw, and roll. The number of degrees of freedom for this robot arm can be extended to 9 by allowing three-dimensional translations for the base ( Fig). If base rotations are allowed, the robot arm can have a total of 12 degrees of freedom. The human body, in comparison, has more than 200 degrees of freedom. Computer-Animation Languages
Prof. Yogesh N, Dept. of CSD, ATMECE YN 7 Computer-Animation Languages
Prof. Yogesh N, Dept. of CSD, ATMECE YN 8 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 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. Computer-Animation Languages
Prof. Yogesh N, Dept. of CSD, ATMECE YN 9 Animation of simple objects is relatively straightforward. It becomes much more difficult to create realistic animation of more complex figures such as humans or animals. Consider the animation of walking or running human (or humanoid) characters. Based upon observations in their own lives of walking or running people, viewers will expect to see animated characters move in particular ways. If an animated character’s movement doesn’t match this expectation, the believability of the character may suffer. Thus, much of the work involved in character animation is focused on creating believable movements. Character Animation
Prof. Yogesh N, Dept. of CSD, ATMECE YN 10 A basic technique for animating people, animals, insects, and other critters is to model them as articulated figures. Articulated figures are hierarchical structures composed of a set of rigid links that are connected at rotary joints ( Fig.). Animate objects are modeled as moving stick figures, or simplified skeletons, that can later be wrapped with surfaces representing skin, hair, fur, feathers, clothes, or other outer coverings. Articulated Figure Animation
Prof. Yogesh N, Dept. of CSD, ATMECE YN 11 The connecting points, or hinges, for an articulated figure are placed at the shoulders, hips, knees, and other skeletal joints, which travel along specified motion paths as the body moves. For example, when a motion is specified for an object, the shoulder automatically moves in a certain way and, as the shoulder moves, the arms move. Different types of movement, such as walking, running, or jumping, are defined and associated with particular motions for the joints and connecting links . A series of walking leg motions, for instance, might be defined as in Fig. (next slide). The hip joint is translated forward along a horizontal line, while the connecting links perform a series of movements about the hip, knee, and angle joints. Articulated Figure Animation
Prof. Yogesh N, Dept. of CSD, ATMECE YN 12 Starting with a straight leg [ Fig. (a )], the first motion is a knee bend as the hip moves forward [ Fig. (b )]. Then the leg swings forward, returns to the vertical position, and swings back, as shown in Fig. (c ), (d), and ( e). The final motions are a wide swing back and a return to the straight vertical position, as in Fig. (f ) and (g). This motion cycle is repeated for the duration of the animation as the figure moves over a specified distance or time interval. Articulated Figure Animation
Prof. Yogesh N, Dept. of CSD, ATMECE YN 13 When animation is constructed with repeated motion patterns, such as a rotating object, the motion should be sampled frequently enough to represent the movements correctly. The motion must be synchronized with the frame-generation rate so that enough frames are displayed per cycle to show the true motion. Otherwise , the animation may be displayed incorrectly A typical example of an under sampled periodic-motion display is the wagon wheel in a Western movie that appears to be turning in the wrong direction . Fig. (next slide) illustrates one complete cycle in the rotation of a wagon wheel with one red spoke that makes 18 clockwise revolutions per second. Periodic Motions
Prof. Yogesh N, Dept. of CSD, ATMECE YN 14 If this motion is recorded on film at the standard motion-picture projection rate of 24 frames per second, then the first five frames depicting this motion would be as shown in Fig (next slide). Periodic Motions
Prof. Yogesh N, Dept. of CSD, ATMECE YN 15 Because the wheel completes 3/4 of a turn every 1/24 of a second, only one animation frame is generated per cycle, and the wheel thus appears to be rotating in the opposite (counterclockwise) direction. In a computer-generated animation, the sampling rate in a periodic motion can be controlled by adjusting the motion parameters. Angular increment for the motion of a rotating object can be set so that multiple frames are generated in each revolution. Thus, a 3◦ increment for a rotation angle produces 120 motion steps during one revolution, and a 4◦ increment generates 90 steps. Periodic Motions
Prof. Yogesh N, Dept. of CSD, ATMECE YN 16 For faster motion, larger rotational steps could be used. The motion of a complex object can be much slower than we want it to be if it takes too long to construct each frame of the animation . Another factor that we need to consider in the display of a repeated motion is the effect of round-off in the calculations for the motion parameters. We can reset parameter values periodically to prevent the accumulated error from producing erratic motions. For a continuous rotation, we could reset parameter values once every cycle (360º). Periodic Motions
Prof. Yogesh N, Dept. of CSD, ATMECE YN 17 Raster operations and color-index assignment functions are available in the core library, and routines for changing color-table values are provided in GLUT. Other raster-animation operations are available only as GLUT routines because they depend on the window system in use. In addition, computer-animation features such as double buffering may not be included in some hardware systems . Double-buffering operations, if available, are activated using the following GLUT command : glutInitDisplayMode (GLUT_DOUBLE); This provides two buffers, called the front buffer and the back buffer, that we can use alternately to refresh the screen display. While one buffer is acting as the refresh buffer for the current display window, the next frame of an animation can be constructed in the other buffer. OpenGL Animation Procedures
Prof. Yogesh N, Dept. of CSD, ATMECE YN 18 We specify when the roles of the two buffers are to be interchanged using glutSwapBuffers ( ); To determine whether double-buffer operations are available on a system, we can issue the following query: glGetBooleanv (GL_DOUBLEBUFFER, status); A value of GL_TRUE is returned to array parameter status if both front and back buffers are available on a system. Otherwise, the returned value is GL_FALSE . For a continuous animation, we can also use glutIdleFunc ( animationFcn ); where parameter animationFcn can be assigned the name of a procedure that is to perform the operations for incrementing the animation parameters. This procedure is continuously executed whenever there are no display-window events that must be processed. To disable the glutIdleFunc , we set its argument to the value NULL or the value 0 OpenGL Animation Procedures
Prof. Yogesh N, Dept. of CSD, ATMECE YN 19 Summary In today’s session, you all have gone through the following topics Computer-Animation Languages Character Animation Periodic Motions OpenGL Animation Procedures
Prof. Yogesh N, Dept. of CSD, ATMECE YN 20 Discussion and Interaction
Prof. Yogesh N, Dept. of CSD, ATMECE YN 21 Topics for Next Session Module-4 : Introduction to Image processing: overview, Nature of IP, IP and its related fields, Digital Image representation, types of images. Digital Image Processing Operations: Basic relationships and distance metrics, Classification of Image processing Operations. Text book 2: Chapter 3 Experiential learning: Computer vision and OpenCV : What is computer vision, Evolution of computer vision, Application of Computer vision, Feature of OpenCV , OpenCV library modules, OpenCV environment, Reading, writing and storing images using OpenCV . OpenCV drawing Functions. OpenCV Geometric Transformations.