Computer Graphics CSC 630 Lecture 2- Linear Algebra.

Slides:



Advertisements
Similar presentations
CS 450: COMPUTER GRAPHICS LINEAR ALGEBRA REVIEW SPRING 2015 DR. MICHAEL J. REALE.
Advertisements

Geometry (Many slides adapted from Octavia Camps and Amitabh Varshney)
Maths for Computer Graphics
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CSC 123 – Computational Art Points and Vectors
Now Playing: My Mathematical Mind Spoon From Gimme Fiction Released May 10, 2005.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
GG313 Lecture 12 Matrix Operations Sept 29, 2005.
Vectors.
Computer Graphics (Fall 2005) COMS 4160, Lecture 2: Review of Basic Math
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
2D Transformations Unit - 3. Why Transformations? In graphics, once we have an object described, transformations are used to move that object, scale it.
Row 1 Row 2 Row 3 Row m Column 1Column 2Column 3 Column 4.
2IV60 Computer Graphics Basic Math for CG
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
Mathematical Fundamentals
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
1 February 24 Matrices 3.2 Matrices; Row reduction Standard form of a set of linear equations: Chapter 3 Linear Algebra Matrix of coefficients: Augmented.
Patrick Nichols Thursday, September 18, Linear Algebra Review.
Chapter 4.1 Mathematical Concepts
Vectors & Matrices Marq Singer
Matrix Algebra. Quick Review Quick Review Solutions.
Slide Chapter 7 Systems and Matrices 7.1 Solving Systems of Two Equations.
Simple Mathematics for graphics. Volumes from Silhouettes Start with collection of “calibrated” images.
Transformations Dr. Amy Zhang.
CSCE 552 Spring 2011 Math By Jijun Tang. Layered.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Copyright © 2011 Pearson, Inc. 7.2 Matrix Algebra.
Matrices, Transformations and the 3D Pipeline Matthew Rusch Paul Keet.
6.837 Linear Algebra Review Rob Jagnow Monday, September 20, 2004.
Magnitude of a Vector The magnitude of a vector, denoted as |a|, is defined as the square root of the sum of the squares of its components: |a| = (x 2.
Introduction to Matrices and Vectors Sebastian van Delden USC Upstate
Computer Graphics 2D Transformations. 2 of 74 Contents In today’s lecture we’ll cover the following: –Why transformations –Transformations Translation.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate Transformations.
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
MATRIX A set of numbers arranged in rows and columns enclosed in round or square brackets is called a matrix. The order of a matrix gives the number of.
CS 450: COMPUTER GRAPHICS TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Linear Algebra Review Tuesday, September 7, 2010.
Computer Graphics Lecture 11 2D Transformations I Taqdees A. Siddiqi
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Lecture 1 Linear algebra Vectors, matrices. Linear algebra Encyclopedia Britannica:“a branch of mathematics that is concerned with mathematical structures.
MTH108 Business Math I Lecture 20.
CPT450 – Computer Graphics
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Week 4 - Monday CS361.
Math Fundamentals Maths revisit.
Linear Algebra review (optional)
Review: Transformations
Review: Transformations
Linear Algebra Review.
Lecture 03: Linear Algebra
Linear Algebra review (optional)
Linear Algebra A gentle introduction
Math review - scalars, vectors, and matrices
Game Programming Algorithms and Techniques
Presentation transcript:

Computer Graphics CSC 630 Lecture 2- Linear Algebra

2 What is Computer Graphics? Using a computer to generate an image from a representation. Model Image computer

3 Model Representations How do we represent an object? –Points –Mathematical Functions X 2 + Y 2 = R 2 –Polygons (most commonly used) Points Connectivity

4 Linear Algebra Why study Linear Algebra? –Deals with the representation and operations commonly used in Computer Graphics

5 What is a Matrix? A matrix is a set of elements, organized into rows and columns n columns m rows m×n matrix

6 What is a Vector? Vector: n × 1 matrix x y v

7 Representing Points and Vectors A 3D point –Represents a location with respect to some coordinate system A 3D vector –Represents a displacement from a position

8 Basic Operations Transpose: Swap rows with columns

9 Vector Addition Given v = [x y z] T and w = [a b c] T v + w = [x+a y+b z+c] T Properties of Vector addition –Commutative: v + w = w + v –Associative (u + v) + w = u + (v + w) –Additive Identity: v + 0 = v –Additive Inverse: v + (-v) = 0

10 Parallelogram Rule To visualize what a vector addition is doing, here is a 2D example: v w v+w

11 Vector Multiplication Given v = [x y z] T and a Scalar s and t –sv = [sx sy sz] T and tv = [tx ty tz] T Properties of Vector multiplication –Associative: (st)v = s(tv) –Multiplicative Identity: 1v = v –Scalar Distribution: (s+t)v = sv+tv –Vector Distribution: s (v+w) = sv+sw

12 Vector Spaces Consists of a set of elements, called vectors. The set is closed under vector addition and vector multiplication.

13 Dot Product and Distances Given u = [x y z] T and v = [a b c] T –vu = v T u = ax+by+cz The Euclidean distance of u from the origin is denoted by ||u|| and called norm or length –||u|| = sqrt(x 2 +y 2 +z 2 ) –Notice that ||u|| = sqrt(u u) –Unit vector ||u|| = 1, zero vector denoted 0 The Euclidean distance between u and v is sqrt((x-a) 2 +(y-b) 2 +(z-c) 2 )) and is denoted by ||u-v||

14 Properties of the Dot Product Given a vector u, v, w and scalar s –The result of a dot product is a SCALAR value –Commutative: vw = wv –Non-degenerate: vv=0 only when v=0

15 Angles and Projection Alternative view of the dot product vw=||v|| ||w|| cos(  ) where  is the angle between v and w v w v w v=w If v and w have length 1 … v·w = 0v·w = 1 v·w = cos θ θ

16 Angles and Projection If v is a unit vector (||v|| = 1) then if we perpendicularly project w onto v can call this newly projected vector u then ||u|| = vw w vu

17 Cross Product Properties The Cross Product c of v and w is denoted by v  w c Is a VECTOR, perpendicular to the plane defined by v and w The magnitude of c is proportional to the sin of the angle between v and w The direction of c follows the right hand rule. ||v  w||=||v|| ||w|| |sin  | –  is the angle between v and w v  w=-(w  v) v w vwvw

18 Cross Product Given 2 vectors v=[v 1 v 2 v 3 ], w=[w 1 w 2 w 3 ], the cross product is defined to be the determinant of where i,j,k are vectors

19 Matrices A compact way of representing operations on points and vectors 3x3 Matrix A looks like a ij refers to the element of matrix A in i th row and j th column

20 Matrix Addition Just add elements

21 Matrix Multiplication If A is an n  k matrix and B is a k  p then AB is a n  p matrix with entries c ij where c ij =  a is b sj Alternatively, if we took the rows of A and columns of B as individual vectors then c ij = A i B j where the subscript refers to the row and column, respectively Multiply each row by each column

22 Matrix Multiplication Properties Associative: (AB)C = A(BC) Distributive: A(B+C) = AB+AC Multiplicative Identity: I= diag(1) (defined only for square matrix) Identity matrix: AI = A NOT commutative: AB  BA

23 Matrix Inverse If A and B are nxn matrices and AB=BA=I then B is the inverse of A, denoted by A -1 (AB) -1 =B -1 A -1 same applies for transpose

24 Determinant of a Matrix Defined on a square matrix (nxn) Used for inversion If det A = 0, then A has no inverse

25 Determinant of a Matrix For a nxn matrix, where A 1i determinant of (n-1)x(n-1) submatrix A gotten by deleting the first row and the ith column

26 Transformations Why use transformations?  Create object in convenient coordinates  Reuse basic shape multiple times  Hierarchical modeling  System independent  Virtual cameras

27 Translation =+ =+

28 Properties of Translation = = = =

29 Rotations (2D)

30 Rotations 2D So in matrix notation

31 Rotations (3D)

32 Properties of Rotations order matters!

33 Combining Translation & Rotation

34 Combining Translation & Rotation

35 Scaling Uniform scaling iff

36 Homogeneous Coordinates can be represented as where

37 Translation Revisited

38 Rotation & Scaling Revisited

39 Combining Transformations where

40 Transforming Tangents

41 Transforming Normals