CSE4030 Introduction to Computer Graphics

Similar documents
Linear Independence. , v 2. is linearly independent if. =0 iff 1

Lecture 8: Coordinate Frames. CITS3003 Graphics & Animation

I&C 6N. Computational Linear Algebra

Computer Graphics MTAT Raimond Tunnel

Two conventions for coordinate systems. Left-Hand vs Right-Hand. x z. Which is which?

CSC 470 Introduction to Computer Graphics. Mathematical Foundations Part 2

COMP 175 COMPUTER GRAPHICS. Lecture 04: Transform 1. COMP 175: Computer Graphics February 9, Erik Anderson 04 Transform 1

Geometric Image Manipulation

The Affine Group of Transformations

Affine transformations

Affine transformations. Brian Curless CSE 557 Fall 2014

CONVERSION OF COORDINATES BETWEEN FRAMES

03 - Basic Linear Algebra and 2D Transformations

Affine transformations

5) homogeneous and nonhomogeneous systems 5a) The homogeneous matrix equation, A x = 0 is always consistent.

Linear Independence x

Camera Models and Affine Multiple Views Geometry

Introduction. Introduction (2) Easy Problems for Vectors 7/13/2011. Chapter 4. Vector Tools for Graphics

Announcements August 31

On-Line Geometric Modeling Notes FRAMES

Reading. Affine transformations. Vector representation. Geometric transformations. x y z. x y. Required: Angel 4.1, Further reading:

CG Basics 1 of 10. Mathematical Foundations: Vectors, Matrices, & Parametric Equations

Linear Algebra Review Part I: Geometry

2D Geometric Transformations. (Chapter 5 in FVD)

Lecture 5 3D polygonal modeling Part 1: Vector graphics Yong-Jin Liu.

6.837 LECTURE 8. Lecture 8 Outline Fall '01. Lecture Fall '01

Affine transformations

Row Space, Column Space, and Nullspace

Intro Vectors 2D implicit curves 2D parametric curves. Graphics 2011/2012, 4th quarter. Lecture 2: vectors, curves, and surfaces

Lecture 02: 2D Geometry. August 24, 2017

CS 4204 Computer Graphics

Linear Algebra Exam 1 Spring 2007

Reading. 4. Affine transformations. Required: Watt, Section 1.1. Further reading:

CSE 167: Introduction to Computer Graphics Lecture #2: Linear Algebra Primer

Linear equations in linear algebra

The Basis. [5] The Basis

Solving a system by back-substitution, checking consistency of a system (no rows of the form

Mobile Robotics 1. A Compact Course on Linear Algebra. Giorgio Grisetti

CSE 167: Introduction to Computer Graphics Lecture #2: Linear Algebra Primer

Section 1.5. Solution Sets of Linear Systems

MSMS Vectors and Matrices

Linear and affine transformations

Friday, 2 November 12. Vectors

CS 378: Computer Game Technology

Vectors and Matrices

Multiple View Geometry in Computer Vision

1 Overview. CS348a: Computer Graphics Handout #8 Geometric Modeling Original Handout #8 Stanford University Thursday, 15 October 1992

0.2 Vector spaces. J.A.Beachy 1

Mathematics for 3D Graphics

CS 4300 Computer Graphics. Prof. Harriet Fell Fall 2011 Lecture 11 September 29, 2011

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Bastian Steder

Graphics Programming I

Intro Vectors 2D implicit curves 2D parametric curves. Graphics 2012/2013, 4th quarter. Lecture 2: vectors, curves, and surfaces

LS.1 Review of Linear Algebra

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Cyrill Stachniss, Maren Bennewitz, Diego Tipaldi, Luciano Spinello

22m:033 Notes: 1.3 Vector Equations

BARYCENTRIC COORDINATES

Graphics Example: Type Setting

Linear Algebra. Preliminary Lecture Notes

Math 3013 Problem Set 6

Ridig Body Motion Homogeneous Transformations

MATH 2331 Linear Algebra. Section 1.1 Systems of Linear Equations. Finding the solution to a set of two equations in two variables: Example 1: Solve:

Linear Algebra. Preliminary Lecture Notes

2D Geometry. Tuesday September 2 rd, 2014.

DS-GA 1002 Lecture notes 0 Fall Linear Algebra. These notes provide a review of basic concepts in linear algebra.

Quintic beam closed form matrices (revised 2/21, 2/23/12) General elastic beam with an elastic foundation

j=1 [We will show that the triangle inequality holds for each p-norm in Chapter 3 Section 6.] The 1-norm is A F = tr(a H A).

Math 205, Summer I, Week 3a (continued): Chapter 4, Sections 5 and 6. Week 3b. Chapter 4, [Sections 7], 8 and 9

EE Camera & Image Formation

Linear Algebra & Geometry why is linear algebra useful in computer vision?

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

6.1. Inner Product, Length and Orthogonality

Vector and Affine Math

Activity: Derive a matrix from input-output pairs

1. Vectors.

Chapter 3. More about Vector Spaces Linear Independence, Basis and Dimension. Contents. 1 Linear Combinations, Span

5.) For each of the given sets of vectors, determine whether or not the set spans R 3. Give reasons for your answers.

Quantum Computing Lecture 2. Review of Linear Algebra

Data representation and classification

2.3 Terminology for Systems of Linear Equations

Mathematical Fundamentals

Vectors Coordinate frames 2D implicit curves 2D parametric curves. Graphics 2008/2009, period 1. Lecture 2: vectors, curves, and surfaces

6. Linear Transformations.

Introduction to Mobile Robotics Compact Course on Linear Algebra. Wolfram Burgard, Cyrill Stachniss, Kai Arras, Maren Bennewitz

A = u + V. u + (0) = u

Practical Linear Algebra: A Geometry Toolbox

Determine whether the following system has a trivial solution or non-trivial solution:

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Linear Algebra 1/33

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

Math 314H EXAM I. 1. (28 points) The row reduced echelon form of the augmented matrix for the system. is the matrix

1300 Linear Algebra and Vector Geometry Week 2: Jan , Gauss-Jordan, homogeneous matrices, intro matrix arithmetic

Systems of Linear Equations

Chapter 2 Subspaces of R n and Their Dimensions

M3: Multiple View Geometry

2. Preliminaries. x 2 + y 2 + z 2 = a 2 ( 1 )

CMU CS 462/662 (INTRO TO COMPUTER GRAPHICS) HOMEWORK 0.0 MATH REVIEW/PREVIEW LINEAR ALGEBRA

A matrix is a rectangular array of. objects arranged in rows and columns. The objects are called the entries. is called the size of the matrix, and

1.4 Linear Transformation I

MATRICES. a m,1 a m,n A =

Week 4-5: Generating Permutations and Combinations

Transcription:

CSE4030 Introduction to Computer Graphics Dongguk University Jeong-Mo Hong

Week 5 Living in a 3 dimensional world II Geometric coordinate in 3D How to move your cubes in 3D

Objectives Introduce concepts such as dimension and basis Introduce coordinate systems for representing vectors spaces and frames for representing affine spaces Discuss change of frames and bases Introduce homogeneous coordinates

Linear Independence A set of vectors v 1, v 2,, v n is linearly independent if α 1 v 1 +α 2 v 2 +.. α n v n =0 iff α 1 =α 2 = =0 If a set of vectors is linearly independent, we cannot represent one in terms of the others If a set of vectors is linearly dependent, as least one can be written in terms of the others

Dimension In a vector space, the maximum number of linearly independent vectors is fixed and is called the dimension of the space In an n-dimensional space, any set of n linearly independent vectors form a basis for the space Given a basis v 1, v 2,., v n, any vector v can be written as v=α 1 v 1 + α 2 v 2 +.+α n v n where the {α i } are unique

Representation Until now we have been able to work with geometric entities without using any frame of reference, such as a coordinate system Need a frame of reference to relate points and objects to our physical world. For example, where is a point? Can t answer without a reference system World coordinates Camera coordinates

Coordinate Systems Consider a basis v 1, v 2,., v n A vector is written v=α 1 v 1 + α 2 v 2 +.+α n v n The list of scalars {α 1, α 2,. α n }is the representation of v with respect to the given basis We can write the representation as a row or column array of scalars a=[α 1 α 2. α n ] T = α α. α 1 2 n

Example v=2v 1 +3v 2-4v 3 a=[2 3 4] T Note that this representation is with respect to a particular basis For example, in OpenGL we start by representing vectors using the object basis but later the system needs a representation in terms of the camera or eye basis

Coordinate Systems Which is correct? v v Both are because vectors have no fixed location

Frames A coordinate system is insufficient to represent points If we work in an affine space we can add a single point, the origin, to the basis vectors to form a frame v 2 P 0 v 1 v 3

Representation in a Frame Frame determined by (P 0, v 1, v 2, v 3 ) Within this frame, every vector can be written as v=α 1 v 1 + α 2 v 2 +.+α n v n Every point can be written as P = P 0 + β 1 v 1 + β 2 v 2 +.+β n v n

Confusing Points and Vectors Consider the point and the vector P = P 0 + β 1 v 1 + β 2 v 2 +.+β n v n v=α 1 v 1 + α 2 v 2 +.+α n v n They appear to have the similar representations p=[β 1 β 2 β 3 ] v=[α 1 α 2 α 3 ] which confuses the point with the vector A vector has no position v p v Vector can be placed anywhere point: fixed

A Single Representation If we define 0 P = 0 and 1 P =P then we can write v=α 1 v 1 + α 2 v 2 +α 3 v 3 = [α 1 α 2 α 3 0 ] [v 1 v 2 v 3 P 0 ] T P = P 0 + β 1 v 1 + β 2 v 2 +β 3 v 3 = [β 1 β 2 β 3 1 ] [v 1 v 2 v 3 P 0 ] T Thus we obtain the four-dimensional homogeneous coordinate representation v = [α 1 α 2 α 3 0 ] T p = [β 1 β 2 β 3 1 ] T

Homogeneous Coordinates The homogeneous coordinates form for a three dimensional point [x y z] is given as p =[x y z w] T =[wx wy wz w] T We return to a three dimensional point (for w 0) by x x /w y y /w z z /w If w=0, the representation is that of a vector Note that homogeneous coordinates replaces points in three dimensions by lines through the origin in four dimensions For w=1, the representation of a point is [x y z 1]

Homogeneous Coordinates and Computer Graphics Homogeneous coordinates are key to all computer graphics systems All standard transformations (rotation, translation, scaling) can be implemented with matrix multiplications using 4 x 4 matrices Hardware pipeline works with 4 dimensional representations For orthographic viewing, we can maintain w=0 for vectors and w=1 for points For perspective we need a perspective division

Change of Coordinate Systems Consider two representations of a the same vector with respect to two different bases. The representations are where a=[α 1 α 2 α 3 ] b=[β 1 β 2 β 3 ] v=α 1 v 1 + α 2 v 2 +α 3 v 3 = [α 1 α 2 α 3 ] [v 1 v 2 v 3 ] T =β 1 u 1 + β 2 u 2 +β 3 u 3 = [β 1 β 2 β 3 ] [u 1 u 2 u 3 ] T

Representing Second Basis in Terms of First Each of the basis vectors, u1,u2, u3, are vectors that can be represented in terms of the first basis v u 1 = 11 v 1 + 12 v 2 + 13 v 3 u 2 = 21 v 1 + 22 v 2 + 23 v 3 u 3 = 31 v 1 + 32 v 2 + 33 v 3

Matrix Form The coefficients define a 3 x 3 matrix M = 11 21 31 12 22 32 13 23 33 and the bases can be related by a=m T b see text for numerical examples

CSE4030 Break and Q&A

Change of Frames We can apply a similar process in homogeneous coordinates to the representations of both points and vectors Consider two frames: (P 0, v 1, v 2, v 3 ) (Q 0, u 1, u 2, u 3 ) v 2 P 0 v 1 u 1 u 2 Q 0 v 3 u 3 Any point or vector can be represented in either frame We can represent Q 0, u 1, u 2, u 3 in terms of P 0, v 1, v 2, v 3

Representing One Frame in Terms of the Other Extending what we did with change of bases u 1 = 11 v 1 + 12 v 2 + 13 v 3 u 2 = 21 v 1 + 22 v 2 + 23 v 3 u 3 = 31 v 1 + 32 v 2 + 33 v 3 defining a 4 x 4 matrix M = Q 0 = 41 v 1 + 42 v 2 + 43 v 3 + 44 P 0 11 21 31 41 12 22 32 42 13 23 33 43 0 0 0 1

Working with Representations Within the two frames any point or vector has a representation of the same form a=[α 1 α 2 α 3 α 4 ] in the first frame b=[β 1 β 2 β 3 β 4 ] in the second frame where α 4 = β 4 = 1 for points and α 4 = β 4 = 0 for vectors and a=m T b The matrix M is 4 x 4 and specifies an affine transformation in homogeneous coordinates

Affine Transformations Every linear transformation is equivalent to a change in frames Every affine transformation preserves lines However, an affine transformation has only 12 degrees of freedom because 4 of the elements in the matrix are fixed and are a subset of all possible 4 x 4 linear transformations

The World and Camera Frames When we work with representations, we work with n-tuples or arrays of scalars Changes in frame are then defined by 4 x 4 matrices In OpenGL, the base frame that we start with is the world frame Eventually we represent entities in the camera frame by changing the world representation using the model-view matrix Initially these frames are the same (M=I)

Moving the Camera If objects are on both sides of z=0, we must move camera frame M = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 d 1

Lab 5 How to move your cubes in 3D Translation, shear, rotation

Reading Assignment Chapter 4.6~4.10 Figure 4.52~58

CSE4030 Quiz