Animating with Quaternions

Slides:



Advertisements
Similar presentations
Lecture 3: orientation Computer Animation.
Advertisements

#8: Curves and Curved Surfaces CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006.
John C. Hart CS 318 Interactive Computer Graphics
CE Statics Lecture 6.
Cubic Curves CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Computer Animation Algorithms and Techniques
Computer graphics & visualization Key frame Interpolation.
Surfaces Chiew-Lan Tai. Surfaces 2 Reading Required Hills Section Hearn & Baker, sections 8.11, 8.13 Recommended Sections 2.1.4, , 3D Computer.
Chap 3 Interpolating Values
Orientation & Quaternions
Computer Graphics Recitation 2. 2 The plan today Learn about rotations in 2D and 3D. Representing rotations by quaternions.
09/04/02 Dinesh Manocha, COMP258 Bezier Curves Interpolating curve Polynomial or rational parametrization using Bernstein basis functions Use of control.
3D orientation.
CSCE 689: Computer Animation Rotation Representation and Interpolation
CSCE 441: Computer Graphics Rotation Representation and Interpolation
Quaternions CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
CSCE 641: Computer Graphics Rotation Representation and Interpolation Jinxiang Chai.
Rotation representation and Interpolation
Rotation and Orientation: Affine Combination Jehee Lee Seoul National University.
2IV60 Computer Graphics Basic Math for CG
Game Mathematics.
3D Kinematics Consists of two parts 3D rotation 3D translation  The same as 2D 3D rotation is more complicated than 2D rotation (restricted to z- axis)
Quaternion and Virtual Trackball CSE 781 Introduction to 3D Image Generation Han-Wei Shen Winter 2007.
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Rick Parent - CIS681 Background Perception Display Considerations Animation Production Video Technology Orientation Representation.
Paths, Smoothing, Least Squares Fit CS 551/651 Spring 2002.
Computer Graphics Bing-Yu Chen National Taiwan University.
This Week Week Topic Week 1 Week 2 Week 3 Week 4 Week 5
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
Rick Parent - CIS681 ORIENTATION Use Quaternions Interpolating rotations is difficult.
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
1 CS 430/536 Computer Graphics I 3D Transformations World Window to Viewport Transformation Week 2, Lecture 4 David Breen, William Regli and Maxim Peysakhov.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Interpolating Values.
Advanced Computer Graphics Spring 2014
1 Game Mathematics. 2 Matrices Matrices Vectors Vectors Fixed-point Real Numbers Fixed-point Real Numbers Triangle Mathematics Triangle Mathematics Intersection.
110/27/ :47 Graphics II Animation Introduction and Motion Control Session 6.
Animation Dr. Amy Zhang Lecture 8. Reading 2  Hill, Chapters 5 / 7 / 10  Red Book, Chapter 3, “Viewing”  Red Book, Chapter 12, “Evaluators and NURBS”
1 Combining rotation axes Should be obvious that: C 1 C 2 = C 3 C1C1 C2C2 C1C1 C2C2 C3C3 C3C3.
Animating Rotations and Using Quaternions. What We’ll Talk About Animating Translation Animating 2D Rotation Euler Angle representation 3D Angle problems.
CS 551/645 Fall 2000 Parameterized Rotations, Curves, and Surfaces.
Quaternionic Splines of Paths Robert Shuttleworth Youngstown State University Professor George Francis, Director illiMath2001 NSF VIGRE REU UIUC-NCSA.
CS 551/651 Advanced Graphics Arc Length. Assignment 1 Due Week from Thursday Building a Cubic Bézier curve OpenGL/Glut Insert up to 100 points Render.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
CS 551/651 Advanced Graphics Technical Background.
Rick Parent - CIS681 Interpolation and Basic Techniques Representing and interpolating orientations Interpolation Speed control along curve Path following.
Basic Theory (for curve 01). 1.1 Points and Vectors  Real life methods for constructing curves and surfaces often start with points and vectors, which.
Week 5 - Monday.  What did we talk about last time?  Lines and planes  Trigonometry  Transforms  Affine transforms  Rotation  Scaling  Shearing.
1 Dr. Scott Schaefer Quaternions and Complex Numbers.
Derivation of the 2D Rotation Matrix Changing View from Global to Local X Y X’ Y’  P Y Sin  X Cos  X’ = X Cos  + Y Sin  Y Cos  X Sin  Y’ = Y Cos.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Advanced Math.
Fundamentals of Computer Animation Orientation and Rotation.
Computer Graphics Lecture 17 3-D Transformations-I Taqdees A. Siddiqi
Lecture 08: Blending Dr. Manal Helal – Fall 2014
Transformations Review 4/18/2018 ©Babu 2009.
Computer Animation Algorithms and Techniques
CPSC 641: Computer Graphics Rotation Representation and Interpolation
CS 445 / 645 Introduction to Computer Graphics
3D Kinematics Consists of two parts
CS 445 / 645 Introduction to Computer Graphics
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS
Physics Vectors Javid.
Rotation representation and Interpolation
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Orientation3D in Three.JS
Reference W.H. Hayt and J.A. Buck , Engineering Electromagnetics, McGraw-Hill, 8th Ed., J. Edminister, Schaum's Outline of Electromagnetics, McGraw-Hill,
UMBC Graphics for Games
UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Rotation and Orientation: Affine Combination
Presentation transcript:

Animating with Quaternions Given quaternion representations, interpolate through them Cubic, interpolating Use operations efficient with quaternion representation Halfway between 2 quaternions Spherical Linear interpolation

Review of Quaternion Math (cos(q/2),sin(q/2)*A) [s1,v1] + [s2,v2] = [s1+s2,v1+v2] [s1,v1] * [s2,v2] = [s1*s2-v1.v2,s1*v2+s2*v1+v1Xv2] ||q|| = sqrt(s*s + x*x + y*y + z*z) q-1 = [-s,v]/||q||2

Rotation Matrix of a Unit Quaternion [ w,x,y,z] 1-2y2-2z2 2xy-2wz 2xz+2wy 1-2x2-2y2 2xz-2wy 2yz+2wx 1-2x2-2z2 2xy+2wz 2yz-2wx

Review of Quaternion Rotations Rotq(v) = v’ = q * [0,v] * q-1 Rotq(v) = Rotk*q(v) Rotqp(v) = Rotq(Rotp(v) )

spherical linear interpolation Quaternions as points on a 4D sphere Unit quaternion: q=(s,x,y,z), ||q|| = 1 Want equal increment along arc connecting two quaternions on surface of sphere spherical linear interpolation

Linearly interpolate between quaternions q=(sq,xq,yq,zq), p=(sp,xp,yp,zp) q p Note: Simply adding quaternions gives mid-rotation (because a scalar multiple of a quaternion represents the same rotation, you don’t need to divide by 2 to get the ‘average’ rotation)

Interpolation Scalar: K = (1-a) A + a B Euler Angles: (linear interpolation: lerp) Euler Angles: [x,y,z] = (1- a)[xa,ya,za] + a[xb,yb,zb] Quaternions?: Linear interpolation of quaternion values would give unequal rotation increments - need to slerp (spherical linear interpolation)

Quaternion : Power Operator [ cos(q/2), sin(q /2) * A] a = [cos(aq/2), sin(aq /2) * A] q a rotates to q orientation as a goes from 0 to 1 Remember: q and -q represent same orientation q a and (-q) a give different rotation sequences 0< q < p gives short squence; p < q <2 p gives long one Since first term in q is cos(q/2), q gives short sequence if first term is positive

Quaternions as points on a 4D sphere Remember: Rot[s,v] == Rot[-s,-v] Use quaternion representations that are ‘close’ to each other: Given quaternion p, should you interpolate to q or -q? p and q are close if their 4D dot product is greater than zero.

Interpolation of rotations K = (1-a) A + a B Scalar: (lerp) Euler Angles: [x,y,z] = (1-a)[xa,ya,za] + a[xb,yb,zb] Quaternions: q = (qbqa-1) a qa (slerp) q = slerp(qa,qb, a)

Review of Bezier Interpolation Using Catmull-Romm interp of interior control points p0 p1 p2 p3 P(u) = [u3 u2 u 1] p0 p1 p2 p3 -1 1 3 -6 -3

Bezier Interpolation of Quaternions

Interpolation Background De Casteljau construction of Bezier curve u=1/3 P(1/3)

Interpolation Background Easy to compute quaternion half-way point q1/2 = q0 + q01

Quaternion - cubic interpolation pn pn-1 pn+1 pn+2 an 1 an+1 bn+1

Quaternion Interpolation Automatically generating interior (spherical) control points Q n P n A n P n+1 Bisect the span P n-1 Double the arc

Quaternion Interpolation Q n Double(q1,q2) = q2q1-1q2 P n Q n =Double(P n-1, P n) P n-1

Construct Midpoint q1 + q2 = [s1,x1,y1,z1] + [s2,x2,y2,z2] Q n P n A n Bisect(p,q) = (p+q)/||p+q|| A n =Bisect(Q n, P n+1)

Spherical Linear Interpolation

Repeated mid-point interpolation For u = 1/4

Quaternion Interpolation Linearly interpolating between 4 keys Cubic Bezier interpolation among same 4 keys