David Luebke6/12/2016 CS 551 / 645: Introductory Computer Graphics David Luebke

Slides:



Advertisements
Similar presentations
Computer Graphics - Geometry & Representation -
Advertisements

Today Composing transformations 3D Transformations
Points, Vectors, Lines, Spheres and Matrices
Demetriou/Loizidou – ACSC330 – Chapter 4 Geometric Objects and Transformations Dr. Giorgos A. Demetriou Dr. Stephania Loizidou Himona Computer Science.
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
UBI 516 Advanced Computer Graphics
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
MAE152 Computer Graphicsfor Scientists and Engineers Revision of Matrices Relevance to Graphics.
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
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.
Outline for Today More math… Finish linear algebra: Matrix composition
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
3-D Geometry.
Basic Math Vectors and Scalars Addition/Subtraction of Vectors Unit Vectors Dot Product.
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
Vectors.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
2IV60 Computer Graphics Basic Math for CG
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
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.
Kansas State University Department of Computing and Information Sciences CIS 736: Computer Graphics Monday, 26 January 2004 William H. Hsu Department of.
Recap of linear algebra: vectors, matrices, transformations, … Background knowledge for 3DM Marc van Kreveld.
Chapter 4.1 Mathematical Concepts
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.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Computer Graphics in Java1 Objects and Viewers Two basic entities (one object seen from two different positions) :
Computer Graphics Bing-Yu Chen National Taiwan University.
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.
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Vectors and the Geometry of Space 9. Vectors 9.2.
Copyright © Cengage Learning. All rights reserved. 12 Vectors and the Geometry of Space.
Introduction to Matrices and Vectors Sebastian van Delden USC Upstate
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I.
Background Mathematics Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
CS 551 / 645: Introductory Computer Graphics Mathematical Foundations.
Geometric Transformations
Transformations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.
Computer Graphics Matrices
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.
2/28/2016 CS 551 / 645: Introductory Computer Graphics Framebuffer Mathematical Foundations The Rendering Pipeline.
Computer Graphics I, Fall 2010 Geometry.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
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 고려대학교 컴퓨터 그래픽스 연구실.
Introduction; Mathematical Foundations CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Transformations. Modeling Transformations  Specify transformations for objects  Allows definitions of objects in own coordinate systems  Allows use.
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
CS 551 / 645: Introductory Computer Graphics
Game Programming Algorithms and Techniques
Presentation transcript:

David Luebke6/12/2016 CS 551 / 645: Introductory Computer Graphics David Luebke

David Luebke6/12/2016 Administrivia l Office hours: –Luebke: n 2:30 - 3:30 Monday, Wednesday n Olsson 219 –Dale / Jinze / Derek: n Tuesday n Thursday n Friday n Small Hall Unixlab for now n Might move to Olsson 227 later l Assignment 1 postponed till Wednesday

David Luebke6/12/2016 UNIX Section: 4 PM, Olsson 228 l Optional UNIX section led by Dale today –Getting around –Using make and makefiles –Using gdb (if time) l We will use 2 libraries: OpenGL and Xforms –OpenGL native on SGIs; on other platforms Mesa –Xforms: available on all platforms of interest

David Luebke6/12/2016 XForms Intro l Xforms: a toolkit for easily building Graphical User Interfaces, or GUIs –See –Lots of widgets: buttons, sliders, menus, etc. –Plus, an OpenGL canvas widget that gives us a viewport or context to draw into with GL or Mesa. l Quick tour now l You’ll learn the details yourself in Assignment 1

David Luebke6/12/2016 Mathematical Foundations l FvD 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 and affine spaces n Points, vectors, and coordinates –Dot and cross products –Linear transforms and matrices

David Luebke6/12/2016 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 n Corresponding pairs of sides have the same length ratio and are separated by equivalent angles n Any corresponding pairs of sides have same length ratio

David Luebke6/12/2016 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)

David Luebke6/12/2016 3D Geometry l To model, animate, and render 3D scenes, we must specify: –Location –Displacement from arbitrary locations –Orientation l We’ll look at two types of spaces: –Vector spaces –Affine spaces l We will often be sloppy about the distinction

David Luebke6/12/2016 Vector Spaces l Two types of elements: –Scalars (real numbers):  … –Vectors (n-tuples): u, v, w, … l Supports two operations: –Addition operation u + v, with: Identity 0 v + 0 = v Inverse - v + (- v ) = 0 –Scalar multiplication: Distributive rule:  ( u + v ) =  ( u ) +  ( v ) (  +  ) u =  u +  u

David Luebke6/12/2016 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

David Luebke6/12/2016 Vector Spaces: A Familiar Example l Our common notion of vectors in a 2D plane is (you guessed it) a vector space: –Vectors are “arrows” rooted at the origin –Scalar multiplication “streches” the arrow, changing its length (magnitude) but not its direction –Addition uses the “trapezoid rule”: u+v y x u v

David Luebke6/12/2016 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 –Best-known example: Cartesian coordinates n Draw example on the board –Note that a given vector v will have different coordinates for different bases

David Luebke6/12/2016 Vectors And Point l We commonly use vectors to represent: –Points in space (i.e., location) –Displacements from point to point –Direction (i.e., orientation) l But we want points and directions to behave differently –Ex: To translate something means to move it without changing its orientation –Translation of a point = different point –Translation of a direction = same direction

David Luebke6/12/2016 Affine Spaces l To be more rigorous, we need an explicit notion of position l Affine spaces add a third element to vector spaces: points (P, Q, R, …) 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

David Luebke6/12/2016 Affine Spaces l Points, like vectors, can be expressed in coordinates –The definition uses an affine combination –Net effect is same: expressing a point in terms of a basis l Thus the common practice of representing points as vectors with coordinates (see FvD) l Analogous to equating points and integers in C –Be careful to avoid nonsensical operations

David Luebke6/12/2016 Affine Lines: An Aside Parametric representation of a line with a direction vector d and a point P 1 on the line: P(  ) = P origin +  d Restricting 0   produces a ray Setting d to P - Q and restricting 0    1 produces a line segment between P and Q

David Luebke6/12/2016 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 of a vector: length( v ) = sqrt( v v) –Normalizing a vector, making it unit-length –Computing the angle between two vectors: u v = |u| |v| cos(θ) –Checking two vectors for orthogonality –Projecting one vector onto another θ u v

David Luebke6/12/2016 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

David Luebke6/12/2016 Linear Transformations l A linear transformation: –Maps one vector to another –Preserves linear combinations l Thus behavior of linear transformation is completely determined by what it does to a basis l Turns out any linear transform can be represented by a matrix

David Luebke6/12/2016 Matrices By convention, matrix element M rc is located at row r and column c: l By (OpenGL) convention, vectors are columns:

David Luebke6/12/2016 Matrices l Matrix-vector multiplication applies a linear transformation to a vector: l Recall how to do matrix multiplication

David Luebke6/12/2016 Matrix Transformations l A sequence or composition of linear transformations corresponds to the product of the corresponding matrices –Note: the matrices to the right affect vector first –Note: order of matrices matters! The identity matrix I has no effect in multiplication l Some (not all) matrices have an inverse:

David Luebke6/12/2016

The End l Next: drawing lines on a raster display l Reading: FvD 3.2