CS 551 / 645: Introductory Computer Graphics Mathematical Foundations.

Slides:



Advertisements
Similar presentations
Demetriou/Loizidou – ACSC330 – Chapter 4 Geometric Objects and Transformations Dr. Giorgos A. Demetriou Dr. Stephania Loizidou Himona Computer Science.
Advertisements

UBI 516 Advanced Computer Graphics
MAE152 Computer Graphicsfor Scientists and Engineers Revision of Matrices Relevance to Graphics.
Math Review Guest Lecturer: Michiel van de Panne Week 1, Wed Jan 9
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.
Welcome to CSc 830 Advanced Computer Graphics
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Geometry Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Computer Graphics CSC 630 Lecture 2- Linear Algebra.
Basic Math Vectors and Scalars Addition/Subtraction of Vectors Unit Vectors Dot Product.
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter Vector Tools for Graphics.
CS 376b Introduction to Computer Vision 03 / 04 / 2008 Instructor: Michael Eckmann.
CS 376b Introduction to Computer Vision 03 / 04 / 2008 Instructor: Michael Eckmann.
Vectors.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Vectors and scalars A scalar quantity can be described by a single number, with some meaningful unit 4 oranges 20 miles 5 miles/hour 10 Joules of energy.
2IV60 Computer Graphics Basic Math for CG
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
CHS Physics Multiplying Vectors. Three Possibilities 1. Multiplying a Vector by a Scalar 2. Multiplying Vector by a Vector 1. Scalar Product 2. Vector.
Mathematical Fundamentals
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
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.
Patrick Nichols Thursday, September 18, Linear Algebra Review.
Chapter 4.1 Mathematical Concepts
7.1 Scalars and vectors Scalar: a quantity specified by its magnitude, for example: temperature, time, mass, and density Chapter 7 Vector algebra Vector:
Geometry CSC 2141 Introduction to Computer Graphics.
1 Geometry. 2 Objectives Introduce the elements of geometry ­Scalars ­Vectors ­Points Develop mathematical operations among them in a coordinate-free.
Computer Graphics in Java1 Objects and Viewers Two basic entities (one object seen from two different positions) :
Mathematical Foundations Sections A-1 to A-5 Some of the material in these slides may have been adapted from university of Virginia, MIT and Åbo Akademi.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Orthogonal Functions and Fourier Series.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Computer Graphics Lecture 04 Fasih ur Rehman. Last Class Overview of Graphics Systems – Display Devices Colors and colored displays Raster displays and.
CS 325 Introduction to Computer Graphics 02 / 17 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Vectors CHAPTER 7. Ch7_2 Contents  7.1 Vectors in 2-Space 7.1 Vectors in 2-Space  7.2 Vectors in 3-Space 7.2 Vectors in 3-Space  7.3 Dot Product 7.3.
6.837 Linear Algebra Review Rob Jagnow Monday, September 20, 2004.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
Basic Entities Scalars - real numbers sizes/lengths/angles Vectors - typically 2D, 3D, 4D directions Points - typically 2D, 3D, 4D locations Basic Geometry.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
David Luebke2/16/2016 CS 551 / 645: Introductory Computer Graphics Mathematical Foundations The Rendering Pipeline.
Vectors and Scalars and Their Physical Significance.
2/28/2016 CS 551 / 645: Introductory Computer Graphics Framebuffer Mathematical Foundations The Rendering Pipeline.
Computer Graphics I, Fall 2010 Geometry.
CSE 681 Brief Review: Vectors. CSE 681 Vectors Basics Normalizing a vector => unit vector Dot product Cross product Reflection vector Parametric form.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Math Review Week 1, Fri.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Linear Algebra Review Tuesday, September 7, 2010.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
David Luebke6/12/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Vectors Quantities with direction. Vectors and Scalars Vector: quantity needing a direction to fully specify (direction + magnitude) Scalar: directionless.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Introduction; Mathematical Foundations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CA 302 Computer Graphics and Visual Programming
CSC461: Lecture 12 Geometry Objectives
Lecture 03: Linear Algebra
Joshua Barczak CMSC 435 UMBC
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
Game Programming Algorithms and Techniques
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
Presentation transcript:

CS 551 / 645: Introductory Computer Graphics Mathematical Foundations

From last class… l U.S. film projectors play film at 24 fps –Projectors have a shutter to block light during frame advance –To reduce flicker, shutter opens twice for each frame – resulting in 48 fps flashing –48 fps is perceptually acceptable l European film projectors play film at 25 fps –American films are played ‘as is’ in Europe, resulting in everything moving 4% faster –Faster movements and increased audio pitch are considered perceptually acceptable

From last class… l Film to DVD transfer –Problem: 24 film fps must be converted to television interlaced (30) fps l Use 3:2 Pulldown –First frame of movie is broken into first three frames –Next frame of movie is broken into next two frames –Next frame of movie is broken into next three frames…

From last class…

Additional Displays l Display Walls (Princeton)

Additional Displays l Stereo

Mathematical Foundations l Hearn and Baker (A1 – A4) appendix gives good review l I’ll give a brief, informal review of some of the mathematical tools we’ll employ –Geometry (2D, 3D) –Trigonometry –Vector spaces n Points, vectors, and coordinates –Dot and cross products –Linear transforms and matrices

2D Geometry l Know your high school geometry: –Total angle around a circle is 360° or 2π radians –When two lines cross: n Opposite angles are equivalent n Angles along line sum to 180° –Similar triangles: n All corresponding angles are equivalent

Trigonometry l Sine: “opposite over hypotenuse” l Cosine: “adjacent over hypotenuse” l Tangent: “opposite over adjacent” l Unit circle definitions: –sin (  ) = x –cos (  ) = y –tan (  ) = x/y –Etc… (x, y)

Slope-intercept Line Equation Slope = m = rise / run Slope = (y - y1) / (x - x1) = (y2 - y1) / (x2 - x1) Solve for y: y = [(y2 - y1)/(x2 - x1)]x + [-(y2-y1)/(x2 - x1)]x1 + y1 or: y = mx + b x y P2 = (x2, y2) P1 = (x1, y1) P = (x, y)

Parametric Line Equation l Given points P1 = (x1, y1) and P2 = (x2, y2) x = x1 + t(x2 - x1) y = y1 + t(y2 - y1) l When: –t=0, we get (x1, y1) –t=1, we get (x2, y2) –(0<t<1), we get points on the segment between (x1, y1) and (x2, y2) x y P2 = (x2, y2) P1 = (x1, y1)

Other helpful formulas l Length = sqrt (x2 - x1) 2 + (y2 - y1) 2 l Midpoint, p2, between p1 and p3 –p2 = ((x1 + x3) / 2, (y1 + y3) / 2)) l Two lines are perpendicular if: –M1 = -1/M2 –cosine of the angle between them is 0

Coordinate Systems Z X Y Y X Z Right-handed coordinate system Left-handed coordinate system l Grasp z-axis with hand l Roll fingers from positive x-axis towards positive y-axis l Thumb points in direction of z-axis

Points l Points support these operations –Point-point subtraction: Q - P = v n Result is a vector pointing from P to Q –Vector-point addition: P + v = Q n Result is a new point –Note that the addition of two points is not defined P Q v

Vectors l We commonly use vectors to represent: –Points in space (i.e., location) –Displacements from point to point –Direction (i.e., orientation)

Vector Spaces l Two types of elements: –Scalars (real numbers):  … –Vectors (n-tuples): u, v, w, … l Operations: –Addition –Subtraction –Dot Product –Cross Product –Norm

Vector Addition/Subtraction –operation u + v, with: Identity 0 v + 0 = v Inverse - v + (- v ) = 0 –Vectors are “arrows” rooted at the origin –Addition uses the “parallelogram rule”: u+v y x u v u-v y x u v -v

Scalar Multiplication –Scalar multiplication: Distributive rule:  ( u + v ) =  ( u ) +  ( v ) (  +  ) u =  u +  u –Scalar multiplication “streches” a vector, changing its length (magnitude) but not its direction

Dot Product l The dot product or, more generally, inner product of two vectors is a scalar: v 1 v 2 = x 1 x 2 + y 1 y 2 + z 1 z 2 (in 3D) l Useful for many purposes –Computing the length (Euclidean Norm) of a vector: length( v ) = ||v|| = sqrt( v v) –Normalizing a vector, making it unit-length: v = v / ||v|| –Computing the angle between two vectors: u v = |u| |v| cos(θ) –Checking two vectors for orthogonality u v = 0.0 u θ v

u Dot Product l Projecting one vector onto another –If v is a unit vector and we have another vector, w –We can project w perpendicularly onto v –And the result, u, has length w v w v

Dot Product l Is commutative –u v = v u l Is distributive with respect to addition –u (v + w) = u v + u w

Cross Product l The cross product or vector product of two vectors is a vector: l The cross product of two vectors is orthogonal to both l Right-hand rule dictates direction of cross product

Cross Product Right Hand Rule l See: l Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A l Twist your hand about the A-axis such that B extends perpendicularly from your palm l As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

Cross Product Right Hand Rule l See: l Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A l Twist your hand about the A-axis such that B extends perpendicularly from your palm l As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

Cross Product Right Hand Rule l See: l Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A l Twist your hand about the A-axis such that B extends perpendicularly from your palm l As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

Cross Product Right Hand Rule l See: l Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A l Twist your hand about the A-axis such that B extends perpendicularly from your palm l As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

Cross Product Right Hand Rule l See: l Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A l Twist your hand about the A-axis such that B extends perpendicularly from your palm l As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

Triangle Arithmetic l Consider a triangle, (a, b, c) –a,b,c = (x,y,z) tuples l Surface area = s a = ½ * ||(b –a) X (c-a)|| l Unit normal = (1/2s a ) * (b-a) X (c-a) a c b

Vector Spaces l A linear combination of vectors results in a new vector: v =  1 v 1 +  2 v 2 + … +  n v n l If the only set of scalars such that  1 v 1 +  2 v 2 + … +  n v n = 0 is  1 =  2 = … =  3 = 0 then we say the vectors are linearly independent l The dimension of a space is the greatest number of linearly independent vectors possible in a vector set l For a vector space of dimension n, any set of n linearly independent vectors form a basis

Vector Spaces: Basis Vectors l Given a basis for a vector space: –Each vector in the space is a unique linear combination of the basis vectors –The coordinates of a vector are the scalars from this linear combination –If basis vectors are orthogonal and unit length: n Vectors comprise orthonormal basis –Best-known example: Cartesian coordinates –Note that a given vector v will have different coordinates for different bases

Conclusion l Read Chapters 1 – 3 of OpenGL Programming Guide l Assignment 1 out today, due 8 days from now, Wednesday the 12 th