Translation. 3D Transformations. Rotation about z axis. Scaling. CS 4620 Lecture 8. 3 Cornell CS4620 Fall 2009!Lecture 8

Similar documents
3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

Scene Graphs. CS4620/5620: Lecture 7. Announcements. HW 1 out. PA 1 will be out on Wed

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

2D/3D Geometric Transformations and Scene Graphs

CS4620/5620. Professor: Kavita Bala. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Affine Transformations in 3D

Geometric Transformations

CS 428: Fall Introduction to. Transformations in OpenGL + hierarchical modeling. Andrew Nealen, Rutgers, /21/2009 1

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

CS 4204 Computer Graphics

Math background. 2D Geometric Transformations. Implicit representations. Explicit representations. Read: CS 4620 Lecture 6

Transforms. COMP 575/770 Spring 2013

Transforms 1 Christian Miller CS Fall 2011

CSC 470 Computer Graphics

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Chapter 3: Modeling Transformation

Hierarchical Modeling. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

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

Transformations Week 9, Lecture 18

Transformation Pipeline

Rotations (and other transformations) Rotation as rotation matrix. Storage. Apply to vector matrix vector multiply (15 flops)

Vector Algebra Transformations. Lecture 4

CS D Transformation. Junqiao Zhao 赵君峤

GL_MODELVIEW transformation

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010)

CS354 Computer Graphics Rotations and Quaternions

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);

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

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

OpenGL: Open Graphics Library. Introduction to OpenGL Part II. How do I render a geometric primitive? What is OpenGL

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

Linear and Affine Transformations Coordinate Systems

Questions HW1 Transform Q/A. Transform. Shaoting Zhang. May 11, 2008

Computer Graphics Geometric Transformations

Fachhochschule Regensburg, Germany, February 15, 2017

Fall CSCI 420: Computer Graphics. 2.2 Transformations. Hao Li.

CS380: Computer Graphics 2D Imaging and Transformation. Sung-Eui Yoon ( 윤성의 ) Course URL:

Modeling Objects by Polygonal Approximations. Linear and Affine Transformations (Maps)

CS475/675: Computer Graphics End-Semester Examination (Solutions), Fall 2016

Last week. Machiraju/Zhang/Möller/Fuhrmann

Hierarchical Modeling

CS559: Computer Graphics. Lecture 12: OpenGL Transformation Li Zhang Spring 2008

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

Today. Parity. General Polygons? Non-Zero Winding Rule. Winding Numbers. CS559 Lecture 11 Polygons, Transformations

Lecture 5b. Transformation

CS354 Computer Graphics Viewing and Modeling

Computer Graphics. Chapter 7 2D Geometric Transformations

EECE 478. Learning Objectives. Learning Objectives. Linear Algebra and 3D Geometry. Linear algebra in 3D. Coordinate systems

Describe the Orthographic and Perspective projections. How do we combine together transform matrices?

Chapter 3 - Basic Mathematics for 3D Computer Graphics

CSCI E-74. Simulation and Gaming

Transformations. CSCI 420 Computer Graphics Lecture 4

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

CS559: Computer Graphics

Modeling Transform. Chapter 4 Geometric Transformations. Overview. Instancing. Specify transformation for objects 李同益

Exercise Max. Points Total 90

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

Order of Transformations

Jane Li. Assistant Professor Mechanical Engineering Department, Robotic Engineering Program Worcester Polytechnic Institute

Transformations. Questions on Assignment 1? Announcements

Reading. Hierarchical Modeling. Symbols and instances. Required: Angel, sections , 9.8. Optional:

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Graphics and Visualization

OpenGL Transformations

CT5510: Computer Graphics. Transformation BOCHANG MOON

Transformations Computer Graphics I Lecture 4

Mathematics 308 Geometry. Chapter 9. Drawing three dimensional objects

Lecture 4: Transforms. Computer Graphics CMU /15-662, Fall 2016

Transformations IV. Week 3, Wed Jan 20

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

Orientation & Quaternions

Autonomous Navigation for Flying Robots

IntroductionToRobotics-Lecture02

Motivation. Parametric Curves (later Surfaces) Outline. Tangents, Normals, Binormals. Arclength. Advanced Computer Graphics (Fall 2010)

Computer Science 336 Fall 2017 Homework 2

Modeling with Transformations

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

3D Viewing. CS 4620 Lecture 8

An idea which can be used once is a trick. If it can be used more than once it becomes a method

CIS 636 Interactive Computer Graphics CIS 736 Computer Graphics Spring 2011

Linear transformations Affine transformations Transformations in 3D. Graphics 2009/2010, period 1. Lecture 5: linear and affine transformations

CS612 - Algorithms in Bioinformatics

CS418 OpenGL & GLUT Programming Tutorial (IV) MP2 Bonus/Object Picking. Presented by : Wei-Wen Feng 2/20/2008

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

Two possible ways to specify transformations. Each part of the object is transformed independently relative to the origin

COMP 175 COMPUTER GRAPHICS. Lecture 07: Scene Graph. COMP 175: Computer Graphics March 10, Remco Chang 07 Scene Graph

Transformations Computer Graphics I Lecture 4

Introduction to OpenGL Transformations, Viewing and Lighting. Ali Bigdelou

Answers to practice questions for Midterm 1

C OMPUTER G RAPHICS Thursday

Camera Model and Calibration

Lecture 5: Transforms II. Computer Graphics and Imaging UC Berkeley CS184/284A

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Computer Animation II

OpenGL Tutorial. Ceng 477 Introduction to Computer Graphics

More on Transformations. COS 426, Spring 2019 Princeton University

Luiz Fernando Martha André Pereira

Using GLU/GLUT Objects

CV: 3D sensing and calibration

Introduction to Robotics

Transcription:

Translation 3D Transformations CS 4620 Lecture 8 1 2 Scaling Rotation about z axis 3 4

Rotation about x axis Rotation about y axis 5 6 Transformations in OpenGL Stack-based manipulation of model-view transformation, M glmatrixmode(gl_modelview) Specifies model-view matrix glloadidentity() M! 4x4 identity gltranslatef(float ux, float uy, float uz) M! M T glrotatef(float theta, float ux, float uy, float uz) M! M R glscalef(float sx, float sy, float sz) M! M S glloadmatrixf(float[] A) M! A (Note: column major) glmultmatrixf(float[] A) M! M A (Note: column major) Manipulate matrix stack using: glpushmatrix() glpopmatrix() Transformations in OpenGL! glmatrixmode(gl_modelview); glloadidentity(); {// Draw something: glpushmatrix(); gltranslatef(...); glrotatef(15f,...); {// set color and draw simplices glbegin(gl_triangles); glcolor3f(...); glend(); glpopmatrix(); // toss old transform {// Draw something else: glpushmatrix();... glpopmatrix(); // toss old transform 7 8

General Rotation Matrices A rotation in 2D is around a point A rotation in 3D is around an axis so 3D rotation is w.r.t a line, not just a point there are many more 3D rotations than 2D a 3D space around a given point, not just 1D Specifying rotations In 2D, a rotation just has an angle if it s about a particular center, it s a point and angle In 3D, specifying a rotation is more complex basic rotation about origin: unit vector (axis) and angle convention: positive rotation is CCW when vector is pointing at you about different center: point (center), unit vector, and angle this is redundant: think of a second point on the same axis... Alternative: Euler angles stack up three coord axis rotations degeneracies exist, e.g., gimbal lock 2D 3D 9 10 Coming up with the matrix Building general rotations Showed matrices for coordinate axis rotations but what if we want rotation about some random axis? Compute by composing elementary transforms transform rotation axis to align with x axis apply rotation inverse transform back into position Just as in 2D this can be interpreted as a similarity transform Using elementary transforms you need three translate axis to pass through origin rotate about y to get into x-y plane rotate about z to align with x axis Alternative: construct frame and change coordinates choose p, u, v, w to be orthonormal frame with p and u matching the rotation axis apply similarity transform T = F R x (! ) F 1 11 12

Orthonormal frames in 3D! Useful tools for constructing transformations Recall rigid motions affine transforms with pure rotation columns (and rows) form right-handed ONB that is, an orthonormal basis Building 3D frames Given a vector a and a secondary vector b The u axis should be parallel to a; the u v plane should contain b u = u / u w = u x b; w = w / w v = w x u Given just a vector a The u axis should be parallel to a; don t care about orientation about that axis Same process but choose arbitrary b first Good choice is not near a: e.g. set smallest entry to 1 13 14 Building general rotations Building transforms from points Alternative: construct frame and change coordinates choose p, u, v, w to be orthonormal frame with p and u matching the rotation axis apply similarity transform T = F R x (! ) F 1 interpretation: move to x axis, rotate, move back interpretation: rewrite u-axis rotation in new coordinates (each is equally valid) Or just derive the formula once, and reuse it (more later) Recall2D affine transformation has 6 degrees of freedom (DOFs) this is the number of knobs we have to set to define one Therefore 6 constraints suffice to define the transformation handy kind of constraint: point p maps to point q (2 constraints at once) three point constraints add up to constrain all 6 DOFs (i.e. can map any triangle to any other triangle) 3D affine transformation has 12 degrees of freedom count them by looking at the matrix entries we re allowed to change Therefore 12 constraints suffice to define the transformation in 3D, this is 4 point constraints (i.e. can map any tetrahedron to any other tetrahedron) 15 16

Transforming normal vectors Transforming surface normals differences of points (and therefore tangents) transform OK normals do not Derivation of General Rotation Matrix General 3x3 3D rotation matrix General 4x4 rotation about an arbitrary point 17 18