Animation Curves and Splines 2

Similar documents
Animating orientation. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

Fundamentals of Computer Animation

Quaternions and Rotations

Animation. CS 4620 Lecture 32. Cornell CS4620 Fall Kavita Bala

Quaternion properties: addition. Introduction to quaternions. Quaternion properties: multiplication. Derivation of multiplication

Quaternions and Rotations

Animation and Quaternions

Rotations in 3D Graphics and the Gimbal Lock

Jorg s Graphics Lecture Notes Coordinate Spaces 1

Computer Animation II

Splines & Quaternions (splines.txt) by Jochen Wilhelmy a.k.a. digisnap

Transformations: 2D Transforms

Computer Animation Fundamentals. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics

CS 445 / 645 Introduction to Computer Graphics. Lecture 21 Representing Rotations

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Rotation with Quaternions

Fundamentals of Computer Animation

Visualizing Quaternions

Animation. Traditional Animation Keyframe Animation. Interpolating Rotation Forward/Inverse Kinematics

2D and 3D Coordinate Systems and Transformations

CS 475 / CS 675 Computer Graphics. Lecture 16 : Interpolation for Animation

Measuring Lengths The First Fundamental Form

Chapter 6. Curves and Surfaces. 6.1 Graphs as Surfaces

Central issues in modelling

Interpolating/approximating pp gcurves

1 Transformations. Chapter 1. Transformations. Department of Computer Science and Engineering 1-1

Transforms. COMP 575/770 Spring 2013

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1

Curves D.A. Forsyth, with slides from John Hart

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

Animations. Hakan Bilen University of Edinburgh. Computer Graphics Fall Some slides are courtesy of Steve Marschner and Kavita Bala

CS354 Computer Graphics Rotations and Quaternions

12.1 Quaternions and Rotations

SUMMARY. CS380: Introduction to Computer Graphics Track-/Arc-ball Chapter 8. Min H. Kim KAIST School of Computing 18/04/06.

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

Quaternions and Exponentials

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

Quaternions and Rotations

Quaternions and Rotations

Animation. CS 4620 Lecture 33. Cornell CS4620 Fall Kavita Bala

Rotational Joint Limits in Quaternion Space. Gino van den Bergen Dtecta

3.3 Interpolation of rotations represented by quaternions

Realization of orientation interpolation of 6-axis articulated robot using quaternion

Transformations Week 9, Lecture 18

Lab 2A Finding Position and Interpolation with Quaternions

Applications of Dual Quaternions in Three Dimensional Transformation and Interpolation

The Three Dimensional Coordinate System

Background for Surface Integration

Rotation parameters for model building and stable parameter inversion in orthorhombic media Cintia Lapilli* and Paul J. Fowler, WesternGeco.

Part II: OUTLINE. Visualizing Quaternions. Part II: Visualizing Quaternion Geometry. The Spherical Projection Trick: Visualizing unit vectors.

Motivation. Parametric Curves (later Surfaces) Outline. Tangents, Normals, Binormals. Arclength. Advanced Computer Graphics (Fall 2010)

Coordinate Transformations. Coordinate Transformation. Problem in animation. Coordinate Transformation. Rendering Pipeline $ = $! $ ! $!

3D Kinematics. Consists of two parts

Curves and Surfaces. Shireen Elhabian and Aly A. Farag University of Louisville

Hw 4 Due Feb 22. D(fg) x y z (

Le s s on 02. Basic methods in Computer Animation

Visual Recognition: Image Formation

ECE 600, Dr. Farag, Summer 09

a a= a a =a a 1 =1 Division turned out to be equivalent to multiplication: a b= a b =a 1 b

3D Modelling: Animation Fundamentals & Unit Quaternions

CS770/870 Spring 2017 Quaternions

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Visualizing Quaternions

Lecture IV Bézier Curves

Quaternion Interpolation

Computer Animation. Rick Parent

Orientation & Quaternions

CS559 Computer Graphics Fall 2015

Vector Calculus: Understanding the Cross Product

Solution 2. ((3)(1) (2)(1), (4 3), (4)(2) (3)(3)) = (1, 1, 1) D u (f) = (6x + 2yz, 2y + 2xz, 2xy) (0,1,1) = = 4 14

Animation. Animation

Curve and Surface Basics

CS184: Using Quaternions to Represent Rotation

= w. w u. u ; u + w. x x. z z. y y. v + w. . Remark. The formula stated above is very important in the theory of. surface integral.

Dr. Allen Back. Nov. 21, 2014

Retargetting Motion to New Characters. Project Report Xin LI

Freeform Curves on Spheres of Arbitrary Dimension

8(x 2) + 21(y 1) + 6(z 3) = 0 8x + 21y + 6z = 55.

Transformations. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Design considerations

True/False. MATH 1C: SAMPLE EXAM 1 c Jeffrey A. Anderson ANSWER KEY

Objectives. transformation. General Transformations. Affine Transformations. Notation. Pipeline Implementation. Introduce standard transformations

PS Geometric Modeling Homework Assignment Sheet I (Due 20-Oct-2017)

. 1. Chain rules. Directional derivative. Gradient Vector Field. Most Rapid Increase. Implicit Function Theorem, Implicit Differentiation

t dt ds Then, in the last class, we showed that F(s) = <2s/3, 1 2s/3, s/3> is arclength parametrization. Therefore,

You may know these...

Kinematical Animation.

Quaternions and Dual Coupled Orthogonal Rotations in Four-Space

CS612 - Algorithms in Bioinformatics

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Sung-Eui Yoon ( 윤성의 )

9. [20 points] A degree three Bezier curve q(u) has the four control points p 0 = 0,0, p 1 = 2,0, p 2 = 0,2, and p 3 = 4,4.

Application of Quaternion Interpolation (SLERP) to the Orientation Control of 6-Axis Articulated Robot using LabVIEW and RecurDyn

MATH 2023 Multivariable Calculus

3. The three points (2, 4, 1), (1, 2, 2) and (5, 2, 2) determine a plane. Which of the following points is in that plane?

3D Game Engine Programming. Understanding Quaternions. Helping you build your dream game engine. Posted on June 25, 2012 by Jeremiah van Oosten

COMPUTER ANIMATION 3 KEYFRAME ANIMATION, RIGGING, SKINNING AND CHARACTER ANIMATION. Rémi Ronfard, Animation, M2R MOSIG

Transformations Review

Transcription:

Animation Curves and Splines 2

Animation Homework Set up Thursday a simple avatar E.g. cube/sphere (or square/circle if 2D) Specify some key frames (positions/orientations) Associate Animation a time with each key frame Create smooth animations for the avatar movement does it pass through or just near the key frames and positions? & Unity Save the canned animations for later use Provide a couple of examples A crawling bug, a bouncing ball, etc Use unity

Bezier Curves

Bezier Curves Specify control points instead of derivatives

Bezier Curves A Bezier curve is defined by a set of control points P,, P where n determines the order of a Bezier 0 n curve Start from a linear Bezier curve based on two control points, and build recursively A linear Bezier curve is a straight line P () t = (1- t) P + tp P, P 0 1 0 1

Bezier Curves A quadratic Bezier curve is determined by 3 control points P 0, P 1, P 2 P P0,P 1,P 2 (t) is linearly P () t = (1- t) P () t + tp () t P, P, P P, P P, P 0 1 2 0 1 1 2 interpolated on the green line, and the endpoints of the green line lie on linear Bezier curves determined by P 0, P 1 and P 1, P 2 respectively The basis functions are quadratic functions 0 1 2 2 2 P () t = (1- t) P + 2(1 t - t) P + t P P, P, P 0 1 2

Bezier Curves A cubic Bezier curve is determined by 4 control points P () t = (1- t) P () t + tp () t P, P, P, P P, P, P P, P, P 0 1 2 3 0 1 2 1 2 3 P P0 (t) is linearly,p 1,P 2,P 3 interpolated on the blue line, and the path of the two end points of the blue line are quadratic Bezier curves determined by P, P, P and 0 1 2 P, P, P respectively 1 2 3 The basis functions are cubic functions () t = (1- t) 3 + 3(1 t - t) 2 + 3 t 2 (1- t) + t 3 P, P, P, P 0 1 2 3 P P P P P 0 1 2 3

Bezier Curves Higher order Bezier curves are defined recursively P () t = (1- t) P () t + tp () t P, P,..., P P, P,..., P P, P,..., P 0 1 n 0 1 n-1 1 2 n The basis functions of an n th order Bezier curve are n th order polynomials P P, P,..., P 0 1 n n () t = å B n () t P i i= 0 i where ænö B () t = ç t (1-t) èi ø n i n-i i High order Bezier curves are more expensive to evaluate When a complex shape is needed, low order Bezier curves (usually cubic) are connected together

Connecting Cubic Bezier Curves Want velocity to be continuous Need co-linear control points across the junctions

C 0 Continuity for Bezier Curves Points are specified continuously But tangents are specified discontinuously

C 1 Continuity for Bezier Curves Tangents are specified continuously as well

Rotations

Rotation Interpolation Besides translation, the motion of a rigid object also includes rotation Consider an axis of rotation (out of the page) and angles of rotation α with respect to that axis α 0 α 1 Would like the object to smoothly change from one orientation to the other

Rotation Interpolation α 0 α(t) α 1 Linear interpolation of Angles: α(t) = 1 t α 0 + tα 1 Need to be mindful of angle limits Not necessarily the shortest path Suppose we interpolate from α = 1 to α = 359 0 1 This rotates almost a full circle, although the two angles are nearly the same

Recall: 2D Rotation Matrix The columns of the matrix are the new locations of the x and y axes So set the columns to the desired new locations of the x and y axes Rotation matrix = 3D is similar

Euler Angles Euler angles: from the original axes (xyz) α: a rotation around the z-axis (x y z ) β: a rotation around the N-axis (x"y"z") γ: a rotation around the Z-axis (XYZ) Three angles are applied in this fixed sequence N-axis and Z-axis are both moving axes Z (z") x β z α (z C ) (y") β α y y C N(x C )(x") Interpolate rotation using Euler angles Could parameterize each of the angles: α(t), β(t), γ(t)

Euler Angles Euler angles can lead to artifacts: gimbal lock

Question #1 LONG FORM: Summarize how Euler Angles work, and explain gimbal lock. List 5 things you plan to do research on in order to learn more about designing your game (One sentence for each idea). SHORT FORM Form clusters (of about size 5-ish?) with at least one novice gamer in each cluster. Take turns answering questions that person might have, and otherwise giving him/her advice. Write down the best piece of advice you heard.

Quaternions

Quaternions Quaternions are an extension of complex numbers q= s+ xi+ yj+ zk The conjugate of a quaternion is defined as q * = s-xi-yj-zk They are added and subtracted (term by term) as usual. Multiplication is defined as follows: (using the table) qq = ( ss -xx - yy -zz, 1 2 1 2 1 2 1 2 1 2 sx + xs + yz -zy 1 2 1 2 1 2 1 2 sy - xz + ys + zx 1 2 1 2 1 2 1 2 sz + xy - yx + zs 1 2 1 2 1 2 1 2,, )

Unit Quaternions as Rotations A quaternion can be expressed as a scalar/vector pair: q = s, v where v = (x, y, z) A unit (length) quaternion can be obtained by dividing through all the elements by: q = s 2 + x 2 + y 2 + z 2 Each unit quaternion corresponds to a rotation For a rotation around a 3D axis ˆn of angle q, the corresponding unit quaternion is q q (cos,sin ˆ) 2 2 n A quaternion multiplied by a nonzero scalar still corresponds to the same rotation (since normalization removes the scalar)

Unit Quaternions as Rotations A unit quaternion (, sxyz,, ) is equivalent a rotation matrix: 2 2 æ1-2y -2z 2xy- 2sz 2xz+ 2sy ö ç 2xy 2sz 1 2x 2 2z 2 ç + - - 2yz -2sx ç 2 2 è 2xz - 2sy 2sx + 2yz 1-2x -2y ø Rotating a vector by a unit quaternion is faster than using a rotation matrix (a vector can be viewed as a non-unit quaternion with the scalar part set equal to zero) Rotate u = quq S1 The inverse of a unit quaternion is simply its conjugate q ( The inverse of a non-unit quaternion is q S1 = q / q V )

Interpolating Unit Quaternions Unit quaternions can be viewed as points lying on a 4-D unit sphere: (, sxyz,, ) Interpolating between these points means tracing out a curve on the surface of this 4-D sphere This framework allows us to take the shortest path as represented by an arc on the 4D sphere Note: The 3D unit sphere is for illustrating the idea. The unit quaternion sphere is 4D!

SLERP Spherical Linear Interpolation Linearly interpolate between points and on the unit sphere: sin(1 -t) j sin tj qt () = q + q sinj sinj 0 1 q q1 0 According to L'Hôpital's rule, sin tj (sin tj) tcostj lim = lim = lim = sin j (sin j) cosj j 0 j 0 j 0 sin(1 -t) j (sin(1 -t) j) (1 -t)cos(1 -t) j lim = lim = lim = 1- sin j (sin j) cosj j 0 j 0 j 0 t t Therefore, as j goes to zero, we get linear interpolation qt () = (1- tq ) + tq 0 1

Angle Between Unit Quaternions The angle φ between two unit quaternions on a 4D sphere is calculated using: φ = arccos(q 0 [ q 1 ) with a typical dot-product: q 0 [ q 1 = s 0 s 1 + x 0 x 1 + y 0 y 1 + z 0 z 1 φ is guaranteed to be between 0, π However, it still does not guarantee the shortest path, because q and q correspond to the same rotation! So, if q 0 [ q 1 is negative, we negate either q 0 or q 1 before applying SLERP to guarantee the shortest path

SLERP for Unit Quaternions A quaternion q = (s, v ) can be defined in exponential form q = q e _`a = q (cos α + n` sin α) where α and the unit vector n` are defined via: s = q cos α, v = n` v = q n` sin α n` is the rotation axis, and α equals half of the rotation angle The power of a quaternion is then: q e = q e e _`ae Note that the power affects the rotation angle α, but not the rotation axis n` Finally, SLERP for unit quaternions is expressed as: SLERP q 0, q 1 ; t = q 0 (q 0 S1 q 1 ) e

Question #2 LONG FORM: Briefly explain why we use quaternions for rotations. Explain why moving rigid bodies use both a linear and an angular velocities. Answer the Short Form questions as well SHORT FORM Can you think of a particularly visually interesting rigid body used in games, movies, or television? Very briefly describe it. Explain how it makes use of translations and/or rotations for visual effects.