CS 551/645 Fall 2000 Parameterized Rotations, Curves, and Surfaces.

Slides:



Advertisements
Similar presentations
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
Advertisements

John C. Hart CS 318 Interactive Computer Graphics
CS B659: Principles of Intelligent Robot Motion Rigid Transformations.
Chris Hall Aerospace and Ocean Engineering
© University of Wisconsin, CS559 Spring 2004
CS 445 / 645 Introduction to Computer Graphics Lecture 22 Hermite Splines Lecture 22 Hermite Splines.
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
3D Kinematics Eric Whitman 1/24/2010. Rigid Body State: 2D p.
HCI 530 : Seminar (HCI) Damian Schofield. HCI 530: Seminar (HCI) Transforms –Two Dimensional –Three Dimensional The Graphics Pipeline.
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.
Rotation representation and Interpolation
Computer Graphics (Fall 2004) COMS 4160, Lecture 3: Transformations 1
Orientations Goal: –Convenient representation of orientation of objects & characters in a scene Applications to: – inverse kinematics –rigid body simulation.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
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.
CS I400/B659: Intelligent Robotics Rigid 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.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1
1 Kinematics ( 運動學 ) Primer Jyun-Ming Chen Fall 2009.
Game Physics – Part IV Moving to 3D
Transformations Aaron Bloomfield CS 445: Introduction to Graphics
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 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
Key Frame Animation and Inverse Kinematics
This Week Week Topic Week 1 Week 2 Week 3 Week 4 Week 5
3D Computer Graphics An oh so brief introduction.
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.
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.
Advanced Computer Graphics Spring 2014
110/27/ :47 Graphics II Animation Introduction and Motion Control Session 6.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Rotations and Quaternions Week 9, Wed 29 Oct 2003.
Transformations of Objects – 3D
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”
Rotation and Orientation: Fundamentals Jehee Lee Seoul National University.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 17, 2015 TRANSFORMATIONS AFFINE TRANSFORMATIONS QUATERNIONS.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
Review CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2005.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
CS 551/651 Advanced Graphics Technical Background.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
CS 325 Computer Graphics 04 / 30 / 2010 Instructor: Michael Eckmann.
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.
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.
Introduction to Computer Graphics CS 445 / 645 Lecture 10 Chapter 7: Transformations Gimbal.
Fundamentals of Computer Animation Orientation and Rotation.
REFERENCE: QUATERNIONS/ Ogre Transformations.
Transformations Review 4/18/2018 ©Babu 2009.
© University of Wisconsin, CS559 Spring 2004
CPSC 641: Computer Graphics Rotation Representation and Interpolation
CS 445 / 645 Introduction to Computer Graphics
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 TRANSFORMATIONS
Rotations and Quaternions Week 9, Wed 29 Oct 2003
© University of Wisconsin, CS559 Spring 2004
UMBC Graphics for Games
VIRTUAL ENVIRONMENT.
Presentation transcript:

CS 551/645 Fall 2000 Parameterized Rotations, Curves, and Surfaces

Administrivia Demo code for assignment 2 is online –Go to assignment 2 page on class web page Test cases for assignment 2 are online –Go to assignment 2 page on class web page gluScaleImage() working? –To keep things simple, use correctly sized textures at first TA is out of town this week – no office hours –Send me mail about questions / camera checkout –Also, Robertson Media Center should have equipment

Parameterizing Rotations Straightforward in 2D –A scalar, , represents rotation in plane More complicated in 3D –Three scalars are required to define orientation –Note that three scalars are also required to define position –Objects free to translate and tumble in 3D have 6 degrees of freedom (DOF)

Representing 3 Rotational DOFs Euler Angles (3 DOFs) –Rot x + Rot y + Rot z Axis-angle (4 DOFs) –Axis of rotation + Rotation amount Quaternion (4 DOFs) –4 dimensional complex numbers 3x3 Matrix (9 DOFs) –Rows of matrix define orthogonal axes

Euler Angles (  x,  y,  z ) = R z R y R x –Rotate  x degrees about x-axis –Rotate  y degrees about y-axis –Rotate  z degrees about z-axis Axis order is not defined –(y, z, x), (x, z, y), (z, y, x)… are all legal –Pick one

Euler Angles Rotations not uniquely defined –ex: (z, x, y) = (90, 45, 45) = (45, 0, -45) takes positive x-axis to (1, 1, 1) –cartesian coordinates are independent of one another, but Euler angles are not Gimbal Lock –Term derived from mechanical problem that arises in gimbal mechanism that supports a compass or a gyro

Gimbal Lock

Occurs when two axes are aligned Euler angles do not rotate the coordinate axes But, second and third rotations have effect of transforming earlier rotations –ex: Rot x, Rot y, Rot z If Rot y = 90 degrees, Rot z == -Rot x

Interpolation Interpolation between two Euler angles is not unique ex: (x, y, z) rotation order –from (0, 0, 0) to (180, 0, 0) –from (0, 0, 0) to (0, 180, 180) –interpolating each axis of rotation idependently results in different animation sequences

Axis-angle Notation Define an axis of rotation (x, y, z) and a rotation about that axis,  R( , n) 4 degrees of freedom specify 3 rotational degrees of freedom because axis of rotation is constrained to be a unit vector

Axis-angle Notation r RrRr n  r par = (n.r) n r perp = r – (n.r) n V = n x (r – (n.r) n) = n x r Rr = Rr par + Rr perp = Rr par + (cos  ) r perp + (sin  ) V =(n.r) n + cos  (r – (n.r)n) + (sin  ) n x r = (cos  )r + (1 – cos  ) n (n.r) + (sin  ) n x r

Axis-angle Notation No easy way to determine how to concatenate many axis-angle rotations that result in final desired axis-angle rotation No simple way to interpolate rotations

Quaternion Remember complex numbers: a + ib –Where 1 2 = 1 and i 2 = -1 Quaternion: –Q = a + bi + cj + dk Where i 2 = j 2 = k 2 = -1 and ij = k and ji = -k –Represented as: q = (s, v) = s + v x i + v y j + v z k

Quaternion Let q 1 = (s 1, v 1 ) and q 2 = (s 2, v 2 ) –q 1 q 2 = (s 1 s 2 – v 1.v 2, s 1 v 2 + s 2 v 1 + v 1 x v 2 ) –Conjugate = q 1 ’ = (s, -v) –q 1 q 1 ’ = s 2 + |v| 2 = |q| 2 = magnitude If q has unit magnitude –q = (cos , sin  n) –q’ = q -1 –Define a pure quaternion: p = (0, r) –Rotating p by q (0, cos2  r + (1 – cos2  ) n (n.r) + sin2  n.r)

Quaternion Continue to represent quaternion as a 4 DOF vector (as in axis-angle) But use quaternion algebra: –(cos (  /2), sin(  /2) n x, sin(  /2) n y, sin(  /2) n z ) The product of two unit quaternions is a unit quaternion

Quaternion Example X-roll of  –(cos (  /2), sin (  /2) (1, 0, 0) = (0, (1, 0, 0)) Y-roll 0f  –(0, (0, 1, 0) Z-roll of  –(0, (0, 0, 1)) R y (  ) followed by R z (  ) –(0, (0, 1, 0) times (0, (0, 0, 1)) = (0, (0, 1, 0) x (0, 0, 1) = (0, (1, 0, 0))

Quaternion Interpolation Biggest advantage of quaternions –Interpolation –Cannot linearly interpolate between two quaternions because it would speed up in middle –Instead, Spherical Linear Interpolation, slerp() –Used by modern video games for third-person perspective –Why?

Quaternion Code mming/ /quaternions_01.htmhttp:// mming/ /quaternions_01.htm Camera control code – File, gltb.c gltbMatrix and gltbMotion

Using Quaternions in Assignment 3 part 2 Nate’s ‘Smooth’ program uses axis-angle to represent the rotation He then uses glRotate to convert this to a rotation matrix and adds it to the modelview matrix stack Instead, you convert axis-angle to quaternion and then to rotation matrix You then put this rotation matrix on stack

Rotation Matrix 9 DOFs must reduce to 3 Rows must be unit length (-3 DOFs) Rows must be orthogonal (-3 DOFs) Drifting matrices is very bad –Numerical errors results when trying to gradually rotate matrix by adding derivatives –Resulting matrix may scale / shear –Gram-Schmidt algorithm will re-orthogonalize your matrix Difficult to interpolate between matrices

Representations of Curves Problems with series of points used to model a curve –Piecewise linear - Does not accurately model a smooth line –It’s tedious –Expensive to manipulate curve because all points must be repositioned Instead, model curve as piecewise-polynomial –x = x(t), y = y(t), z = z(t) where x(), y(), z() are polynomials

Cubic Polynomials x(t) = a x t 3 + b x t 2 + c x t + d x –Similarly for y(t) and z(t) Let t: (0 <= t <= 1) Let T = [t 3 t 2 t 1] Coefficient Matrix C Curve: Q(t) = T.C

Parametric Curves Derivative of Q(t) is the tangent vector at t: –d/dt Q(t) = Q’(t) = d/dt T. C = [3t 2 2t 1 0]. C

Continuity of Curves Two curves that join together –G 0, geometric continuity If direction (but not necessarily magnitude) of tangent matches –G 1 geometric continuity Matching tangent vectors (direction and magnitude) –C 1 continuous, first-degree continuity in t (parametric continuity) Matching direction and magnitude of d n / dt n C n continous

Parametric Curves Hermite – two endpoints and two endpoint tangent vectors Bezier - two endpoints and two other points that define the endpoint tangent vectors Splines – four control points. –C1 and C2 continuity at the join points –Come close to their control points, but not guaranteed to touch them

Parametric Curves Difficult to conceptualize curve as –x(t) = a x t 3 + b x t 2 + c x t + d x Instead, define curve as weighted combination of 4 well-defined cubic polynomials Each curve type defines different cubic polynomials and weighting schemes