Transformations 5 University of British Columbia

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

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Transformations III Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Transformations II Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations III Week.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Viewing/Projections I.
Math Review Guest Lecturer: Michiel van de Panne Week 1, Wed Jan 9
Transformations II Week 2, Wed Jan 17
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
Transformations IV Week 3, Wed Jan 23
© Tamara Munzner University of British Columbia Hierarchical modelling recap: composing transforms recap: composing transforms finish: rendering pipeline.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Transformations V Week.
Outline for Today More math… Finish linear algebra: Matrix composition
3-D Geometry.
1 Geometrical Transformation Tong-Yee Lee. 2 Modeling Transform Specify transformation for objects Allow definitions of objects in own coordinate systems.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Projections Fri 19 Oct 2003 recap: viewing projections.
MSU CSE 803 Fall 2008 Stockman1 CV: 3D sensing and calibration Coordinate system changes; perspective transformation; Stereo and structured light.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Transformations III Week.
University of British Columbia © MIchiel van de Panne An Introduction to Computer Animation Michiel van de Panne.
Stockman MSU/CSE Math models 3D to 2D Affine transformations in 3D; Projections 3D to 2D; Derivation of camera matrix form.
Computer Graphics (Fall 2005) COMS 4160, Lecture 2: Review of Basic Math
CS 450: Computer Graphics 2D TRANSFORMATIONS
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology 3D Engines and Scene Graphs Spring 2012.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
Rick Parent - CIS681 ORIENTATION Use Quaternions Interpolating rotations is difficult.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 4: Transformations 2
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
WARM UP: Describe in words how to rotate a figure 90 degrees clockwise.
Transformations
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Math Review Week 1, Fri.
Matrix Transformations Reference: “3D Math Primer for Graphics and Game Development” – , , , , 9.4
CGDD 4003 Character Animation. The Skeletal Hierarchy (aka the “rig”) Based on the concept of bones Each bone has exactly one parent Each bone has a transform.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Viewing/Projections I.
Transformations University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
Reference: “3D Math Primer for Graphics and Game Development, 2 nd ed.” Chapter 5 Chapter 6.x MATRIX.
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Final Review I University of British Columbia
CSE 167 [Win 17], Lecture 3: Transformations 1 Ravi Ramamoorthi
Math Fundamentals Maths revisit.
CPSC 641: Computer Graphics Rotation Representation and Interpolation
3D Geometric Transformation
Computer Graphics CC416 Week 15 3D Graphics.
3D Geometric Transformations
Introduction to Computer Graphics CS 445 / 645
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016
GIF's by POV-Ray and GIAM a tiny crash course
Introducing Blender.
Introducing Blender.
Transformations 6 University of British Columbia
COMP 175: Computer Graphics February 9, 2016
Transformations 3 University of British Columbia
Chapter IV Spaces and Transforms
COMP 175: Computer Graphics February 21, 2016
Transformations IV Week 3, Wed Jan 20
(c) University of Wisconsin, CS559
Transformations 4 University of British Columbia
Hierarchical Modeling & Constructive Solid Geometry
CSCE441: Computer Graphics Coordinate & Composite Transformations
Transformations IV Week 3, Mon Jan 22
Transformations III Week 3, Mon Jan 21
Transformations II Week 2, Fri Jan 18
CSCE441: Computer Graphics 2D/3D Transformations
Chapter 2 Mathematical Analysis for Kinematics
Transformations IV Week 3, Wed Jan 23
Transformations 2 University of British Columbia
Screw Rotation and Other Rotational Forms
Presentation transcript:

Transformations 5 University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Transformations 5 http://www.ugrad.cs.ubc.ca/~cs314/Vjan2016

Assignments project 1 out today, due 11:59pm sharp Tue Feb 2 projects will go out before we’ve covered all the material so you can think about it before diving in build star-nosed mole out of cubes and 4x4 matrices think cartoon, not beauty http://www.ugrad.cs.ubc.ca/~cs314/Vjan2016/p1.pdf template code gives you program shell http://www.ugrad.cs.ubc.ca/~cs314/Vjan2016/p1.zip theory homework 1 out today, due 2pm sharp Wed Jan 27 (start of class) theoretical side of material http://www.ugrad.cs.ubc.ca/~cs314/Vjan2016/h1.pdf

Real Star-Nosed Moles https://youtu.be/RCB2VT3Nw1I jpg http://aninfopage.blogspot.ca/2011/12/star-nose-mole.html http://www.rsba.ca/recherche_espece/fiche_espece.php?recordID=334 http://www.biokids.umich.edu/critters/Condylura_cristata/ http://animals.howstuffworks.com/mammals/mole-info.htm https://youtu.be/RCB2VT3Nw1I

Star-Nosed Moles! out of boxes and matrices

Cartoon motion: armadillo jumpcut

Cartoon motion: armadillo jumpcut

Project 1 Advice do not model everything first and only then worry about animating interleave modelling, animation for each body part: add it, then jumpcut animate, then smooth animate discover if on wrong track sooner dependencies: can’t get anim credit if no model use body as scene graph root check from multiple camera angles

Project 1 Advice finish all required parts before going for extra credit playing with lighting or viewing construct your 4x4 matrix by hand without rotate(), translate(), scale() commands in Three.js do not interpolate numbers within matrix even though it’s safe to linearly interpolate parameters you use to create matrix

Project 1 Advice smooth transition change happens gradually over X frames key click triggers animation one way: redraw happens X times linear interpolation: each time, param += (new-old)/30 or redraw happens over X seconds even better, but not required

Style you can lose up to 15% for poor style most critical: reasonable structure yes: parametrized functions no: cut-and-paste with slight changes reasonable names (variables, functions) adequate commenting rule of thumb: what if you had to fix a bug two years from now? global variables are indeed acceptable

Version Control bad idea: just keep changing same file save off versions often after got one thing to work, before you try starting next just before you do something drastic use version control software strongly recommended: easy to browse previous work, revert use meaningful comments to describe what you did “started on tail”, “fixed head breakoff bug”, “leg code compiles but doesn’t run” useful when you’re working alone, critical when working together

General Rotation

Rotation About a Point: Moving Object rotate about p by : translate p to origin rotate about origin translate p back FW

Rotation: Changing Coordinate Systems same example: rotation around arbitrary center

Rotation: Changing Coordinate Systems rotation around arbitrary center step 1: translate coordinate system to rotation center

Rotation: Changing Coordinate Systems rotation around arbitrary center step 2: perform rotation

Rotation: Changing Coordinate Systems rotation around arbitrary center step 3: back to original coordinate system

General Transform Composition transformation of geometry into coordinate system where operation becomes simpler typically translate to origin perform operation transform geometry back to original coordinate system

Rotation About an Arbitrary Axis axis defined by two points translate point to the origin rotate to align axis with z-axis (or x or y) perform rotation undo aligning rotations undo translation

Arbitrary Rotation arbitrary rotation: change of basis Z X arbitrary rotation: change of basis given two orthonormal coordinate systems XYZ and ABC A’s location in the XYZ coordinate system is (ax, ay, az, 1), ...

Arbitrary Rotation arbitrary rotation: change of basis (bx, by, bz, 1) Y Z X B C A Y Z X (ax, ay, az, 1) (cx, cy, cz, 1) arbitrary rotation: change of basis given two orthonormal coordinate systems XYZ and ABC A’s location in the XYZ coordinate system is (ax, ay, az, 1), ...

Arbitrary Rotation arbitrary rotation: change of basis (bx, by, bz, 1) Y Z X B C A Y Z X (ax, ay, az, 1) (cx, cy, cz, 1) arbitrary rotation: change of basis given two orthonormal coordinate systems XYZ and ABC A’s location in the XYZ coordinate system is (ax, ay, az, 1), ... transformation from one to the other is matrix R whose columns are A,B,C:

Transformation Hierarchies

Transformation Hierarchies scene may have a hierarchy of coordinate systems stores matrix at each level with incremental transform from parent’s coordinate system scene graph road stripe1 stripe2 ... car1 car2 w1 w3 w2 w4

Transformation Hierarchy Example 1 torso head RUarm RLarm Rhand RUleg RLleg Rfoot LUarm LLarm Lhand LUleg LLleg Lfoot world trans(0.30,0,0) rot(z, )

Transformation Hierarchy Example 2 draw same 3D data with different transformations: instancing

Matrix Stacks challenge of avoiding unnecessary computation using inverse to return to origin computing incremental T1 -> T2 Object coordinates World coordinates T1(x) T2(x) T3(x)