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

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

Transformations: 2D Transforms

Animation Curves and Splines 2

Quaternions and Rotations

Transformations Week 9, Lecture 18

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

Computer Animation II

Animation and Quaternions

Rotations in 3D Graphics and the Gimbal Lock

Visual Recognition: Image Formation

Fundamentals of Computer Animation

CS612 - Algorithms in Bioinformatics

Quaternions and Rotations

Fundamentals of Computer Animation

3D Transformations World Window to Viewport Transformation Week 2, Lecture 4

Chapter 2 - Basic Mathematics for 3D Computer Graphics

CS770/870 Spring 2017 Quaternions

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

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

Quaternions & Rotation in 3D Space

Jorg s Graphics Lecture Notes Coordinate Spaces 1

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

Aalto CS-C3100 Computer Graphics, Fall 2016

12.1 Quaternions and Rotations

Quaternions and Rotations

Quaternions and Rotations

ME 597: AUTONOMOUS MOBILE ROBOTICS SECTION 2 COORDINATE TRANSFORMS. Prof. Steven Waslander

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

Rotation with Quaternions

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

Lecture Note 3: Rotational Motion

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

Quaternion Rotations AUI Course Denbigh Starkey

CMSC 425: Lecture 6 Affine Transformations and Rotations

3-D D Euclidean Space - Vectors

CS354 Computer Graphics Rotations and Quaternions

3D Kinematics. Consists of two parts

Computer Animation. Rick Parent

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

Inertial Measurement Units II!

Visualizing Quaternions

CS D Transformation. Junqiao Zhao 赵君峤

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

Attitude Representation

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

Incremental Image Synthesis

2D and 3D Coordinate Systems and Transformations

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

Computer Animation Fundamentals. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics

Chapter 3 : Computer Animation

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

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

QUATERNIONS AND ROTATIONS

Rotation and Orientation: Fundamentals. Perelyaev Sergei VARNA, 2011

Quaternions and Euler Angles

CSC418 / CSCD18 / CSC2504

Orientation & Quaternions

Homework 5: Transformations in geometry

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

Le s s on 02. Basic methods in Computer Animation

Visualizing Quaternions

2D and 3D Transformations AUI Course Denbigh Starkey

Computer Vision. Coordinates. Prof. Flávio Cardeal DECOM / CEFET- MG.

Computer Graphics. Chapter 5 Geometric Transformations. Somsak Walairacht, Computer Engineering, KMITL

3D Transformation. In 3D, we have x, y, and z. We will continue use column vectors:. Homogenous systems:. x y z. x y z. glvertex3f(x, y,z);

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

IMAGE-BASED RENDERING AND ANIMATION

Kinematics. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University

CS230 : Computer Graphics Lecture 12: Introduction to Animation. Tamar Shinar Computer Science & Engineering UC Riverside

Vector Calculus: Understanding the Cross Product

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

Reading. Topics in Articulated Animation. Character Representation. Animation. q i. t 1 t 2. Articulated models: Character Models are rich, complex

Analysis of Euler Angles in a Simple Two-Axis Gimbals Set

Quaternions. Ken Shoemake Department of Computer and Information Science University of Pennsylvania Philadelphia, PA 19104

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

PSE Game Physics. Session (3) Springs, Ropes, Linear Momentum and Rotations. Oliver Meister, Roland Wittmann

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

Interactive Computer Graphics. Hearn & Baker, chapter D transforms Hearn & Baker, chapter 5. Aliasing and Anti-Aliasing

Animation. Animation

Short on camera geometry and camera calibration

Mobile Application Programming: Android. OpenGL ES 3D

Comparison of practically applicable mathematical descriptions of orientation and rotation in the three-dimensional Euclidean space

Hello, welcome to the video lecture series on Digital Image Processing. So in today's lecture

Computer Animation III

Quaternions and Exponentials

Introduction to quaternions. Mathematics. Operations

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

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

Exercise 1: Kinematics of the ABB IRB 120

Object Representation Affine Transforms. Polygonal Representation. Polygonal Representation. Polygonal Representation of Objects

MATHEMATICS FOR ENGINEERING TUTORIAL 5 COORDINATE SYSTEMS

Quaternions: From Classical Mechanics to Computer Graphics, and Beyond

Advanced Computer Graphics Transformations. Matthias Teschner

Game Engineering CS S-05 Linear Transforms

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

Section Parametrized Surfaces and Surface Integrals. (I) Parametrizing Surfaces (II) Surface Area (III) Scalar Surface Integrals

Mobile Application Programming. OpenGL ES 3D

Elements of three dimensional geometry

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

EE Kinematics & Inverse Kinematics

Transcription:

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

Orientation in the plane θ (cos θ, sin θ) ) R θ ( x y = sin θ ( cos θ sin θ )( x y ) cos θ

Refresher: Homogenous coordinates v = v x v y v z 1 T tx,t y,t z (v) = S sx,s y,s z (v) = 1 0 0 t x 0 1 0 t y 0 0 1 t z 0 0 0 1 s x 0 0 0 0 s y 0 0 0 0 s z 0 0 0 0 1 v x v y v z 1 v x v y v z 1

Orientation in 3D R x α = 1 0 0 0 0 cos(α) sin(α) 0 0 sin(α) cos(α) 0 0 0 0 1 R y β = cos(β) 0 sin(β) 0 0 1 0 0 sin(β) 0 cos(β) 0 0 0 0 1 R z γ = cos(γ) sin(γ) 0 0 sin(γ) cos(γ) 0 0 0 0 1 0 0 0 0 1

Orientation in 3D Any orientation in 3D can be represented as a combination of three angles, specifying three consecutive rotations around axes. R α,β,γ = R z γr y β Rx α or? R α,β,γ = R x αr y β Rz γ or R α,β,γ = RαR z βr x γ z? These are fixed-angle or Euler angle representations. (Equivalent up to changing the order.)

Interpolation and gimbal lock (c) The Guerilla CG Project

Gimbal

Interpolation and gimbal lock interactive demonstration

Euler s theorem (well, one of them) Any orientation can be specified by a rotation of angle θ about an axis n θ n

Quaternions An elegant representation of rotation in terms of axis and angle Interpolates smoothly Easy to compose

Quaternions Higher-dimensional complex numbers q = s + xi+yj+zk q =(s, x, y, z) q =(s, v) i 2 =j 2 =k 2 = ijk = 1 ij = k jk = i ki = j ji = -k kj = -i ik = -j

Quaternion arithmetic q + q = (s, v)+(s, v ) = ( s + xi+yj+zk ) + ( s + x i+y j+z k ) = (s + s )+(x + x )i + (y + y )j + (z + z )k = (s + s, v + v ) qq = (s, v)(s, v ) = ( s + xi+yj+zk )( s + x i+y j+z k ) = ss ( xx + yy + zz ) + s ( x i+y j+z k ) + s ( xi+yj+zk ) + (yz zy )i + (zx xz )j + (xy yx )k

Quaternion arithmetic q + q = (s, v)+(s, v ) = ( s + xi+yj+zk ) + ( s + x i+y j+z k ) = (s + s )+(x + x )i + (y + y )j + (z + z )k = (s + s, v + v ) qq = (s, v)(s, v ) = ( s + xi+yj+zk )( s + x i+y j+z k ) = ss ( xx + yy + zz ) + s ( x i+y j+z k ) + s ( xi+yj+zk ) +(yz zy )i + (zx xz )j + (xy yx )k = ( ss vv, v v + sv + s v )

Quaternion multiplicative inverse q 1 = (s, v) q 2 qq 1 = (s, v)(s, v) q 2 = s2 + v 2 q 2 =1

Representing rotation with quaternions θ v n ( q = cos θ 2, n sin θ 2 p = (0, v) R θ,n (v) =qpq 1 ) n =1 q 1 = ( cos θ 2, n sin θ 2 )

Representing rotation with quaternions qpq 1 = ( cos θ 2, sin θ 2 n) (0, v) ( cos θ 2, sin θ 2 n) = ( cos θ 2, sin θ 2 n)( sin θ 2 vn, sin θ 2 (v n) + cos θ 2 v) = ( cos θ 2, sin θ 2 n)( sin θ 2 vn, sin θ 2 (n v) + cos θ 2 ( v) = sin θ 2 cos θ 2 vn sin2 θ 2 n(n v) sin θ 2 cos θ 2 nv, = = = sin 2α = 2 sin α cos α cos 2α = cos 2 α sin 2 α cos 2α = 1 2 sin 2 α ) sin 2 θ 2 n (n v) + sin θ 2 cos θ 2 (n v) + sin θ 2 cos θ 2 (n v) + cos2 θ 2 v + sin2 θ 2 n(vn) ( ) 0, sin 2 ) 2( θ n(nv) v(nn) + 2 sin θ 2 cos θ 2 (n v) + cos2 θ 2 v + sin2 θ 2 n(vn) ) (0, 2 sin 2 θ2 n(vn) + 2 sin θ2 cos θ2 (n v) + cos2 θ2 v sin2 θ2 v ( ) 0, (1 cos θ)n(vn) + sin θ(n v) + cos θv v u = u v v (u w) = u(vw) w(vu)

Representing rotation with quaternions u v θ v v α n Now what does rotation of v by about n actually do? θ R θ,n (v) = R θ,n (v )+R θ,n (v ) = v + (cos θ)v + (sin θ)u = n(vn) + (cos θ) ( v n(vn) ) + (sin θ)v n = (1 cos θ)n(vn) + (cos θ)v + (sin θ)v n = qpq 1 v n = v n sin α u u vn = v n cos α

Interpolating quaternions Quaternions that represent rotation as described so far lie on the unit sphere in the four-dimensional quaternion space. Any quaternion q represents rotation, the same as q/ q. We can linearly interpolate between two quaternions by treating them as generic four-dimensional vectors, but the interpolation would speed up in the middle.

Interpolating quaternions Instead we interpolate on the unit sphere. This results in smooth uniform motion.

Spherical Linear Interpolation (slerp) p = slerp(q 1,q 2,u) =? p q 1 q 2 uθ θ

Spherical Linear Interpolation (slerp) p = slerp(q 1,q 2,u) = cos(uθ)q 1 + sin(uθ)r = cos(uθ)q 1 + sin(uθ) q 2 cos(θ)q 1 sin(θ) = = sin(θ) cos(uθ) cos(θ) sin(uθ) sin(θ) sin((1 u)θ) sin(θ) q 1 + sin(uθ) sin(θ) q 2 q 1 + sin(uθ) sin(θ) q 2 q 2 r θ uθ p q 1 q 2 = cos(θ)q 1 + sin(θ)r r = q 2 cos(θ)q 1 sin(θ)

Interpolating through the smaller angle angle q and -q represent the same rotation. q = ( cos θ 2, n sin ) θ 2 q = ( cos θ 2, n sin ) θ 2 = ( cos ( ( )) π + 2) θ, n sin π + θ 2 = ( ) cos 2π+θ 2, n sin 2π+θ 2 To interpolate from p to q through the smaller angle, compute the distances p-q and p+q and choose the smaller one.

Higher orders of continuity Bezier curves on the unit sphere of quaternions. See Shoemake, Animating Rotation with Quaternion Curves, SIGGRAPH 1985, for details.

Conversions Animators still specify orientation keys in Euler angles. Euler angles provide a visually intuitive and familiar interface. They are fine for specifying individual keys, just not interpolation. Interpolation is done in quaternions. We need to regularly convert between rotation matrices and quaternions.

Conversions: Quaternions to matrices q =(s, x, y, z) A = 1 2(y 2 + z 2 ) 2xy 2sz 2sy +2xz 0 2xy +2sz 1 2(x 2 + z 2 ) 2sx +2yz 0 2sy +2xz 2sx +2yz 1 2(x 2 + y 2 ) 0 0 0 0 1 See Shoemake, Animating Rotation with Quaternion Curves, SIGGRAPH 1985, for details.

Conversions: Matrices to quaternions A = A 00 A 01 A 02 A 03 A 10 A 11 A 12 A 13 A 20 A 21 A 22 A 23 A 30 A 31 A 32 A 33 q =(s, x, y, z) s = ± 1 2 A00 + A 11 + A 22 + A 33 x = A 21 A 12 4s y = A 02 A 20 4s z = A 10 A 01 4s follows from previous slide by simple arithmetic, remembering that q =1.