Rotation representation and Interpolation

Slides:



Advertisements
Similar presentations
Lecture 3: orientation Computer Animation.
Advertisements

John C. Hart CS 318 Interactive Computer Graphics
3.3. Introduction to Real-time Physics III
Three Dimensional Modeling Transformations
Animation Following “Advanced Animation and Rendering Techniques” (chapter 15+16) By Agata Przybyszewska.
Computer Animation Algorithms and Techniques
3D Kinematics Eric Whitman 1/24/2010. Rigid Body State: 2D p.
CMPE 466 COMPUTER GRAPHICS
Orientation & Quaternions
Computer Graphics Recitation 2. 2 The plan today Learn about rotations in 2D and 3D. Representing rotations by quaternions.
3D Coordinate Systems and Transformations Revision 1
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.
Orientations Goal: –Convenient representation of orientation of objects & characters in a scene Applications to: – inverse kinematics –rigid body simulation.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Technical Background.
CS 445 / 645 Introduction to Computer Graphics Lecture 21 Representing Rotations Lecture 21 Representing Rotations.
Computer Graphics 3D Transformations. 3D Translation Remembering 2D transformations -> 3x3 matrices, take a wild guess what happens to 3D transformations.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Computer Vision Group Prof. Daniel Cremers Autonomous Navigation for Flying Robots Lecture 3.1: 3D Geometry Jürgen Sturm Technische Universität München.
1 Kinematics ( 運動學 ) Primer Jyun-Ming Chen Fall 2009.
Rotations and Translations
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
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)
CS 450: COMPUTER GRAPHICS QUATERNIONS SPRING 2015 DR. MICHAEL J. REALE.
Computer Graphics Bing-Yu Chen National Taiwan University.
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
1 KIPA Game Engine Seminars Jonathan Blow Ajou University December 13, 2002 Day 16.
Rotations and Translations
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Rick Parent - CIS681 ORIENTATION Use Quaternions Interpolating rotations is difficult.
Maths and Technologies for Games Quaternions CO3303 Week 1.
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
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
Chapter 2 Rigid Motions and Coordinate Transformations
Animating Rotations and Using Quaternions. What We’ll Talk About Animating Translation Animating 2D Rotation Euler Angle representation 3D Angle problems.
Rotation and Orientation: Fundamentals Jehee Lee Seoul National University.
Matthew Christian. About Me Introduction to Linear Algebra Vectors Matrices Quaternions Links.
CS 551/645 Fall 2000 Parameterized Rotations, Curves, and Surfaces.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
Chapter 2: Description of position and orientation Faculty of Engineering - Mechanical Engineering Department ROBOTICS Outline: Introduction. Descriptions:
Comparing Two Motions Jehee Lee Seoul National University.
CS 551/651 Advanced Graphics Technical Background.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
3-D Geometric Transformations
3D Geometric Transformation
This Week WeekTopic Week 1 Coordinate Systems, Basic Functions Week 2 Trigonometry and Vectors (Part 1) Week 3 Vectors (Part 2) Week 4 Vectors (Part 3:
Euler Angles This means, that we can represent an orientation with 3 numbers Assuming we limit ourselves to 3 rotations without successive rotations about.
Week 5 - Monday.  What did we talk about last time?  Lines and planes  Trigonometry  Transforms  Affine transforms  Rotation  Scaling  Shearing.
EE 495 Modern Navigation Systems Navigation Mathematics Rotation Matrices – Part II Wednesday, Jan 14 EE 495 Modern Navigation Systems Slide 1 of 21.
Learning from the Past, Looking to the Future James R. (Jim) Beaty, PhD - NASA Langley Research Center Vehicle Analysis Branch, Systems Analysis & Concepts.
Fundamentals of Computer Animation Orientation and Rotation.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
REFERENCE: QUATERNIONS/ Ogre Transformations.
Computer Animation Algorithms and Techniques
CPSC 641: Computer Graphics Rotation Representation and Interpolation
3D Geometric Transformation
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS
Rotation representation and Interpolation
UMBC Graphics for Games
UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN
Rotation and Orientation: Fundamentals
Presentation transcript:

Rotation representation and Interpolation CSE 3541 Matt Boggus

Rotation Matrices

Interpolating Orientations in 3D Rotation matrices Given rotation matrices Mi and time ti, find M(t) such that M(ti)=Mi ux vx nx uy vy ny uz vz nz u v n

Flawed Solution Interpolate each entry independently Example: M0 is identity and M1 is 90o around x-axis Is the result a rotation matrix?

Orientation Representations Rotation matrix Fixed angles: rotate about global coordinate system Euler angles: rotate about local coordinate system Axis-angle: arbitrary axis and angle Quaternions: mathematically handy axis-angle 4-tuple

Fixed Angles Any orientation can be described by composing three rotations, one around each global coordinate axis Roll, pitch and yaw (perfect for flight simulation) http://www.fho-emden.de/~hoffmann/gimbal09082002.pdf

Gimbal Lock Two or more axes align resulting in a loss of rotation degrees of freedom. http://www.fho-emden.de/~hoffmann/gimbal09082002.pdf

Fixed Angles in the Real World Apollo inertial measurement unit To “prevent” lock, they added a fourth Gimbal http://www.hq.nasa.gov/office/pao/History/alsj/gimbals.html

Axis-Angle Q Y A X Z Rotate about given axis Euler’s Rotation Theorem Fairly easy to interpolate between orientations Difficult to concatenate rotations

Axis-angle to rotation matrix Y Z Concatenate the following: Rotate A around z to x-z plane Rotate A’ around y to x-axis Rotate theta around x Undo rotation around y-axis Undo rotation around z-axis Q A

Quaternions (intuitionally) X Y Z Q A Same as axis-angle, but different form Still rotate about given axis Mathematically convenient form Note: in this form v is a scaled version of the given axis of rotation, A (which is a vector)

Quaternion q = s + xi + yj + zk where i, j, and k are imaginary numbers Rotation Quaternions Identity (no rotation) 1, -1 180 degrees about x-axis i, -i 180 degrees about y-axis j, -j 180 degrees about z-axis k, -k angle θ, axis (unit vector)

Quaternion Arithmetic Addition Multiplication Inner Product Length

Quaternion Arithmetic Inverse Identity Unit quaternion

Quaternion Representation and Rotation Vector Rotation

Unit Quaternion Conversions Axis-Angle

What an animator needs to know Quaternions What an animator needs to know Avoid gimbal lock Easy to rotate a point Easy to convert to a rotation matrix Easy to concatenate – quaternion multiply Easy to interpolate – interpolate 4-tuples

Rotations within Unity transform.Rotate(eulerAngles : Vector3, relativeTo : Space = Space.Self) Description Applies a rotation of eulerAngles.z degrees around the z axis, eulerAngles.x degrees around the x axis, and eulerAngles.y degrees around the y axis (in that order).

Rotations within Unity transform.Rotate(axis : Vector3, angle : float, relativeTo : Space = Space.Self) Description Rotates the transform around axis by angle degrees.

Rotations within Unity transform.RotateAround(point : Vector3, axis : Vector3, angle : float) Description Rotates the transform about axis passing through point in world coordinates by angle degrees. This modifies both the position and the rotation of the transform.

Rotations within Unity Vector3.RotateTowards(current : Vector3, target : Vector3, maxRadiansDelta : float, maxMagnitudeDelta : float) Description Rotates a vector current towards target.

Orientation along a curve

Orientation on a curve in 2D

Orientation on a curve in 2D

Orientation on a curve in 2D q1 and q2 are orthogonal to P’(u) i.e. q1 = Rotate(90) * P’(u) q2 = Rotate(-90) * P’(u)

Frenet Frame Global axes: x, y, z Local axes: u, v, w a moving (coordinate) frame that provides a coordinate system at each point of the curve that is "best adapted" to the curve near that point Global axes: x, y, z Local axes: u, v, w P(s) = parametric curve function with s on [0,1]

Frenet Frame tangent & curvature vector

Frenet Frame tangent & curvature vector

local coordinate system Frenet Frame local coordinate system Directly control orientation of object/camera Use for direction and bank into turn, especially for ground-planar curves (e.g. roads) w = P’(s) u = P’’(s) × P’(s) v = w × u

Frenet Frame – sometimes undefined

Frenet Frame – discontinuity

Other ways to control orientation Use auxiliary curve to define direction or up vector Use point P(s+ds) for direction

Direction & Up vector To keep ‘head up’, use y-axis to compute over and up vectors perpendicular to direction vector v = u × w w If up vector supplied, use that instead of y-axis u=w × y-axis Direction vector

Orientation interpolation Preliminary note: Remember that Affects of scale are divided out by the inverse appearing in quaternion rotation When interpolating quaternions, use UNIT quaternions – otherwise magnitudes can interfere with spacing of results of interpolation

Orientation interpolation Quaternions can be interpolated to produce in-between orientations: 2 problems analogous to issues when interpolating positions: How to take equidistant steps along orientation path? How to pass through orientations smoothly (1st order continuous) And another particular to quaternions: with dual unit quaternion representations, which to use?

Dual representation Dual unit quaternion representations: q = –q For Interpolation between q1 and q2, compute cosine between q1 and q2 and between q1 and –q2; choose smallest angle

Interpolating quaternions Unit quaternions form set of points on 4D sphere Linearly interpolating unit quaternions: not equally spaced

Interpolating quaternions in great arc => equal spacing

Interpolating quaternions with equal spacing where ‘slerp’, sphereical linear interpolation is a function of the beginning quaternion orientation, q1 the ending quaternion orientation, q2 the interpolant, u Still a linear order interpolation