Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part II Application of Linear Combination.

Slides:



Advertisements
Similar presentations
Department of nskinfo i-education
Advertisements

Department of nskinfo i-education
Animation Marco Gillies. Computer Animation Making things move A key aspect of computer graphics Non-realtime for films Realtime for virtual worlds and.
2006 by Jim X. Chen: 1.1. Review –Graphics commands specify straight lines or other geometric primitives that are scan-converted.
Linear Interpolation Applying “weighted averages” to some graphics problems: animations and curve-drawing.
Vector Calculus Mengxia Zhu Fall Objective Review vector arithmetic Distinguish points and vectors Relate geometric concepts to their algebraic.
Branch Predictor Animations Bi-modal, Local, Global CS450/650 Andrew Morton.
Lab 12: Animations User Interface Lab: GUI Lab Nov 11 th, 2014.
1 Computer Graphics Week6 –Basic Transformations- Translation & Scaling.
1 Introduction Curve Modelling Jack van Wijk TU Eindhoven.
Computer graphics & visualization Key frame Interpolation.
Introduction We have dealt with polylines and mesh shapes. We want a way to describe curved shapes which will make them easy to draw.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
1 3D modelling with OpenGL Brian Farrimond Robina Hetherington.
University of North Carolina at Greensboro
Computer Graphics 12: Spline Representations
ENDS 375 Foundations of Visualization Geometric Representation 9/30/04.
Vertical Retrace Interval An introduction to VGA techniques for smooth graphics animation.
ARCH 481 3d Modeling and Rendering lecture eight: animation.
COEN Computer Graphics I
Based on slides created by Edward Angel
Vectors.
Course Overview, Introduction to CG Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Friday, September 5, 2003.
2003CS Hons RW778 Graphics1 Chapter 4: Vector Tools 4.5 Representation of Key Geometric Objects 4.5 Representation of Key Geometric Objects –4.5.1 Coordinate.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 CMT Fundamentals of Computer Graphics Revision Dr. Xiaohong Gao BG---Room 2C23 Week 11.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Introduction to Advanced Animation Types of animation Low Level Control (a start) (Ch. 15) We’re.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
1Computer Graphics Input and Interaction Lecture 8 John Shearer Culture Lab – space 2
Review of Interpolation. A method of constructing a function that crosses through a discrete set of known data points.
Computer Graphics I, Fall 2010 Input and Interaction.
Vector Computer Graphic. Vector entities Line Circle, Ellipse, arc,… Curves: Spline, Bezier’s curve, … … Areas Solids Models.
Graphics Systems and OpenGL. Business of Generating Images Images are made up of pixels.
Homogeneous Form, Introduction to 3-D Graphics Glenn G. Chappell U. of Alaska Fairbanks CS 381 Lecture Notes Monday, October 20,
Yingcai Xiao Game Development Interactive Animation.
Curves. First of all… You may ask yourselves “What did those papers have to do with computer graphics?” –Valid question Answer: I thought they were cool,
Java: An Eventful Approach An innovative approach to teaching Java in CS1 † Recursion Kim B. Bruce, Andrea Danyluk & Tom Murtagh Williams College † Partially.
INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve.
CS559: Computer Graphics Lecture 24: Shape Modeling Li Zhang Spring 2010.
Yingcai Xiao Game Development Animation. Video Game Interactive animation: user-> interface (look) -> action (feel) -> feedback (A/V, haptic)
Interactive Computer Graphics CS 418 MP1: Dancing I TA: Zhicheng Yan Sushma S Kini Mary Pietrowicz Slides Taken from: “An Interactive Introduction to OpenGL.
Rujchai Ung-arunyawee Department of Computer Engineering Khon Kaen University.
Introduction to OpenGL and GLUT. What’s OpenGL? An Application Programming Interface (API) A low-level graphics programming API – Contains over 250 functions.
1 Input and Interaction. 2 Objectives Introduce the basic input devices ­Physical Devices ­Logical Devices ­Input Modes Event-driven input Introduce double.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
Coordinate Systems and Coordinate Frames  vector v = (3, 2, 7)  point P = (5, 3, 1)  coordinate frame consists of a specific point, V, called the origin,
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
University of New Mexico
NoufNaief.net TA: Nouf Al-harbi.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Bezier example  Interaction  Animation  Tracking  Menus  Debugging.
Animation CS418 Computer Graphics John C. Hart.
Color spaces. Draw Buffers Color models. Mathmatical Protocols for defining colors with numbers  RGB Red, Green, Blue  HSV Hue, Saturation, Value(Brightness)‏
CAP 4703 Computer Graphic Methods Prof. Roy Levow Chapter 9.
CSCI480/582 Lecture 10 Chap.2.3 Cubic Splines – B-Splines and NURBS Feb, 13, 2009.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Rendering Pipeline and Primitive Rasterization.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part III Intersections.
CS 318 Intro to Computer Graphics John C. Hart
Computer Science I Animations. Bouncing ball. The if statement. Classwork/homework: bouncing something. Compress and upload work to Moodle.
Introduction to Animation In animation, a series of images are rapidly changed to create an illusion of movement.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 17 Animations, Loops.
Modeling Transformations Mario Costa Sousa University of Calgary CPSC 453, Fall 2001 Mario Costa Sousa University of Calgary CPSC 453, Fall 2001.
Vector 2.
Introduction to Game Development
Game Development Animation
Input and Interaction Ed Angel
Input and Interaction Ed Angel
Presentation transcript:

Chi-Cheng Lin, Winona State University CS430 Computer Graphics Vectors Part II Application of Linear Combination

2 Topics l Lerp and Tweening l Double Buffering l Quadratic and Cubic Tweening

3 Lerp and Tween l Linear interpolation (lerp) of two points: P = A(1 - t) + Bt = A + (B – A)t zLerp: affine combination of A and B zP : “tween” at t of points A and B l lerp(a, b, t) returns the fraction t of the way from a to b float lerp(float a, float b, float t) { return a + (b – a) * t }

4 Tweening for Animation l Morphing zInterpolation between corresponding vertices of two polylines zFig 4.22 and 4.24: interpolation zFig 4.25: interpolation and extrapolation

5 Tweening for Animation

6 l Generation of key frames l Compute a smooth path to move the camera between key frames

7 Tweening Routines - Tween l Tween: returns the tween at t of two points A and B Point2 Canvas::Tween(Point2 A, Point2 B, float t) // code of Tween is similar to lerp

8 Tweening Routines - drawTween l drawTween: draws the tween polyline at t of two polylines A and B of n vertices void Canvas::drawTween(Point2 A[], Point2 B[], int n, float t) { Point2 P = Tween( A[0], B[0], t); moveTo(P); for (int i=1; i<n; i++) { P = Tween( A[i], B[i], t); lineTo(P); }

9 Tweening Routines - drawAll l drawAll: draws all the tween polylines of two polylines A and B of n vertices on canvas cvs void drawAll(Point2 A[], Point2 B[], int n) { for (float t=0.0f; t<=1.0; t+= 0.01f) { glClear(GL_COLOR_BUFFER_BIT); cvs.drawTween( A, B, n, t); glutSwapBuffers(); }

10 Double Buffering l To generate an animation we can erase the current picture and then draw a new picture l Problem: Process of drawing new picture could be seen  bad visual effect l Solution: double buffering zDraw the new picture in an off-screen buffer and then display it by swapping the on-screen and off-screen buffers

11 Double Buffering in OpenGL l Initializing display mode glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB); l Swap buffers when a new picture ready glutSwapBuffers();

12 Quadratic and Cubic Tweening l Quadratic tweening z1 = ((1 – t) + t) 2 = (1 – t) 2 + 2(1 – t) + t 2 l Bezier Curve for 3 points A, B, and C zP = (1 - t) 2 A + 2t (1 – t)B + t 2 C l Cubic tweening z1 = ((1-t)+t) 3 =(1-t) 3 + 3(1-t) 2 t + 3(1-t)t 2 + t 3 l Cubic interpolation between 4 points A, B, C, and D : zP = (1-t) 3 A + 3(1-t) 2 t B+ 3(1-t)t 2 C + t 3 D

13 Quadratic and Cubic Tweening P(0) P(1) P(t)P(t) P(t)P(t)