DOC PREVIEW
OSU CS 553 - Simple Key frame Animation

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

2/15/20111Simple Keyframe Animationfor Scientific and Engineering ConceptualizationMike [email protected] – February 15, 2011Oregon State UniversityComputer GraphicsOregon State UniversityThe Problem• Sometimes “visualization” means explaining an idea or a concept or a process to someone• Often, this idea is not data-driven or equation-driven, but rather is general concept-driven•How can we create such an animation without doing a lot of work?mjb – February 15, 2011Oregon State UniversityComputer Graphics•How can we create such an animation without doing a lot of work?Approaches to Animation1. Use the laws of physics2. Use functional (goal-driven) animation3. Use keyframingmjb – February 15, 2011Oregon State UniversityComputer GraphicsKeyframingPixarKeyframing involves creating certain key positions for the objects in the scene, and then later developing the animation frames in between the key frames.In traditional animation, the key frames were developed by the senior animators, and the in-between frames were developed by the junior animators.In our case, you are going to be the senior animator, and the computer will do the in-betweening.mjb – February 15, 2011Oregon State UniversityComputer GraphicsPixarBut, first we need to look into the mathematics of smooth curves . . .Bézier Curves: the Derivation01 0 1(1 )PtP tP P11 1mjb – February 15, 2011Oregon State UniversityComputer GraphicsP0Bézier Curves: the Derivation01 0 112 1 2(1 )(1 )PtP tPPtPtPP11 1mjb – February 15, 2011Oregon State UniversityComputer Graphics12 1 2(1 )PtPtPP0P22/15/20112Bézier Curves: the Derivation01 0 112 1 2(1 )(1 )PtPtPPtPtP P11 11 2 1mjb – February 15, 2011Oregon State UniversityComputer Graphics12 1 222012 01 12 0 1 2(1 )(1 ) (1 ) 2 (1 )PtPtPPtP tP t P t tP tP     P0P2Bézier Curves: the Derivation01 0 112 1 2(1 )(1)PtPtPPtP tPP1P31 11 2 1mjb – February 15, 2011Oregon State UniversityComputer Graphics12 1 222012 01 12 0 1 222123 12 23 1 2 3()(1 ) (1 ) 2 (1 )(1) (1) 2(1)PtP tP t P t tP tPPtP tP t P t tP tP          P0P2Bézier Curves: the Derivation01 0 112 1 2(1 )(1)PtPtPPtP tP  P1P31 11 2 113 31mjb – February 15, 2011Oregon State UniversityComputer Graphics12 1 222012 01 12 0 1 222123 12 23 1 2 3()(1 ) (1 ) 2 (1 )(1) (1) 2(1)PtP tP t P t tP tPPtP tP t P t tP tP          32230123 012 123 0 1 2 3(1) (1) 3(1) 3(1)PtP tP t P t t P t tP tP       P0P21 3 3 132230123( ) (1 ) 3 (1 ) 3 (1 )Pt t P t t P t tP tP     Bézier Curves: Drawing and Sculptingt = 0., .02, .04, .06, …, .98, 1.0mjb – February 15, 2011Oregon State UniversityComputer Graphics3223( ) (1 ) 3 (1 ) 3 (1 )Pt t P t t P t tP tP  The General Form of Cubic Curves23()Pt A Bt Ct Dt  In this form, you need to determine 4 quantities (A, B, C, D) in order to use the equation. That means you have to provide 4 pieces of information. In the Bézier curve, this happens by specifying the 4 points.mjb – February 15, 2011Oregon State UniversityComputer Graphics0123( ) (1 ) 3 (1 ) 3 (1 )Pt t P t t P t tP tP00101201233336333APBPPCPPPDPPPP    Rearranging gives:Coons (also called Hermite) Cubic CurvesAnother approach to specifying the 4 pieces of information would be to give a start point, an end point, a start slope, and an end slope.P00dPPdt11dPPdt●●mjb – February 15, 2011Oregon State UniversityComputer Graphics000101010133222APBPCPPPPDPPPP 23PABtCt Dt  If we do this, then the equation of the curve is:0P1Pwhere:●●●●●2/15/20113Now, Let’s Apply this to the Y Translation of the Keyframe Animationmjb – February 15, 2011Oregon State UniversityComputer GraphicsYThe Y vs. Frame Curve Looks Like Thismjb – February 15, 2011Oregon State UniversityComputer GraphicsFrame #3000 525450 800600200Computing the End Slopes for the Y Translation00001dY dY dFYdt dF dt11011YYdYdF F F20120YYdYdF F FFFdF1dY dY dFYddFd●●mjb – February 15, 2011Oregon State UniversityComputer Graphics000101010133222AYBYCYYYYDYYYY   23YABtCt Dt  1010011. 0.FFdFFFdt11101dtdF dt●●●●●Y650400650650Getting the Two End Slopesmjb – February 15, 2011Oregon State UniversityComputer GraphicsFrame #3000 5254502001iiiidY dY dFdt dF dt111iiiidY dY dFdt dF dtY650400650650Getting the Two End Slopesii-1 i+1 i+2mjb – February 15, 2011Oregon State UniversityComputer GraphicsFrame #3000 5254502001111iiiiiYYdYdF F F212iiiiiYYdYdF F F1iidFdtY650400650650Getting the Two End Slopesii-1 i+1 i+2mjb – February 15, 2011Oregon State UniversityComputer GraphicsFrame #3000 5254502001111650 650450 200iiiiiYYdYdF F F212650 400525 300iiiiiYYdYdF F F111450 300 1501. 0.iiiiiiFFdFFFdt2/15/20114Y650400650650Getting the Two End Slopesmjb – February 15, 2011Oregon State UniversityComputer GraphicsFrame #3000 52545020010150 0250iiiidY dY dFdt dF dt111250150 166.7225iiiidY dY dFdt dF dtDo This Same Thing for the X, Y, and Z Translations and the X, Y, and Z Rotationsmjb – February 15, 2011Oregon State UniversityComputer Graphicsif( AnimationIsOn ){// # msec into the cycle ( 0 - MSEC-1 ):int msec = glutGet( GLUT_ELAPSED_TIME ) % MSEC;// turn that into the current frame number:NowFrame = (int) ( (float)MAXFRAME * (float)msec / (float)MSEC );// look through the keyframes and figure out which two keyframes this is between:Using the System Clock in Animate( ) for Timingmjb – February 15, 2011Oregon State UniversityComputer Graphicsfor( int i = 0; i < maxKeyframes -1; i++ ){if( ????? ){KeyFrameBefore = ?????;KeyFrameAfter = ?????;break;}}// get the t (0.-1.) for that frame in that interval:NowT = ?????// determine the A, B, C, and D for all the interpolation curves in that interval:Ax, Bx, Cx, Dx = ?????Ay, By, Cy, Dy = ?????. . .// use the coefficients and t to


View Full Document

OSU CS 553 - Simple Key frame Animation

Download Simple Key frame Animation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Simple Key frame Animation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Simple Key frame Animation 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?