2/7/2001Hofstra University – CSC290B1 Review: Math (Ch 4)

Slides:



Advertisements
Similar presentations
1Computer Graphics Homogeneous Coordinates & Transformations Lecture 11/12 John Shearer Culture Lab – space 2
Advertisements

Transformations Ed Angel Professor Emeritus of Computer Science
Computer Graphics Lecture 4 Geometry & Transformations.
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
CMPE 466 COMPUTER GRAPHICS
Math 1Hofstra University – CSC171A1 Modeling Objects by Polygonal Approximations Define volumetric objects in terms of surfaces patches that surround the.
Math Foundations of CG Math 1 Hofstra University.
Modeling Objects by Polygonal Approximations
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
Ch. 2: Rigid Body Motions and Homogeneous Transforms
Transformations Objectives Understand how transformations work in 2D and 3D Understand the concept of homogenous coordinate system Understand scene graphs.
Math Foundations of CG Math 1 Hofstra University.
Math Foundations of CG Math 1 Hofstra University.
Transformations. 2 Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple geometry, most of us.
Transformations CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Computer Graphics with OpenGL 3e
Math 1Hofstra University – CSC171A1 Modeling Objects by Polygonal Approximations Define volumetric objects in terms of surfaces patches that surround the.
Vectors.
CS 450: Computer Graphics 2D TRANSFORMATIONS
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Overview of 3D Computer Graphics
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.
CS 480/680 Computer Graphics Representation Dr. Frederick C Harris, Jr. Fall 2012.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Fundamentals of Computer Graphics Part 4
Transformations Dr. Amy Zhang.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
Graphics Graphics Korea University kucg.korea.ac.kr Transformations 고려대학교 컴퓨터 그래픽스 연구실.
Geometric Transformations Jehee Lee Seoul National University.
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Mathematics for Graphics. 1 Objectives Introduce the elements of geometry  Scalars  Vectors  Points Develop mathematical operations among them in a.
Transformations Jehee Lee Seoul National University.
Geometric Objects and Transformation
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.
Geometric Objects and Transformations
CAP 4730 Computer Graphic Methods Prof. Roy Levow Chapter 4.
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate Transformations.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Affine Transformation. Affine Transformations In this lecture, we will continue with the discussion of the remaining affine transformations and composite.
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
1 Graphics CSCI 343, Fall 2015 Lecture 9 Geometric Objects.
Affine Geometry.
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
Computer Graphics I, Fall 2010 Geometry.
Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.
Computer Graphics I, Fall 2010 Transformations.
1 Geometric Transformations Modelling Transforms By Dr.Ureerat Suksawatchon.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Transformations Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Geometric Transformations Ceng 477 Introduction to Computer Graphics Computer Engineering METU.
Graphics Graphics Korea University kucg.korea.ac.kr Geometric Primitives 고려대학교 컴퓨터 그래픽스 연구실.
Graphics Graphics Korea University kucg.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
4. Geometric Objects and Transformations
Modeling Transformations Mario Costa Sousa University of Calgary CPSC 453, Fall 2001 Mario Costa Sousa University of Calgary CPSC 453, Fall 2001.
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
CS5500 Computer Graphics March 6, 2006.
Transformations Objectives
Unit-5 Geometric Objects and Transformations-II
CSC4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Transformations.
Transformations 고려대학교 컴퓨터 그래픽스 연구실 kucg.korea.ac.kr.
Transformations Ed Angel
Geometric Objects and Transformations (II)
Transformations Ed Angel Professor Emeritus of Computer Science
Isaac Gang University of Mary Hardin-Baylor
Presentation transcript:

2/7/2001Hofstra University – CSC290B1 Review: Math (Ch 4)

2/7/2001Hofstra University – CSC290B2 General Purpose Graphics API for use in high level languages Appl.program Graph.API Graph.hardware Primitives and Attributes Geometric and modeling transformations Viewing transformations Hierarchical modeling and manipulation Raster (buffer) oriented transformations Control functions

2/7/2001Hofstra University – CSC290B3 Fundamental Operations Transformation – changes in coordinate systems through matrix operations Clipping – adjusting our view of the world Projection – from 3D to 2D Rasterization – pixels in the frame buffer

2/7/2001Hofstra University – CSC290B4 Geometric Transformations Work in Euclidean affine space: vectors, +, multiplication with scalars, 0 linear combinations, linear independence, basis linear maps (transformations), change of basis points, point+vector, point –point affine combinations, frame inner product, distances, angles, unit vector, perpendicular orthonormal frame, change of frames, affine maps

2/7/2001Hofstra University – CSC290B5 Review: Affine Transformations change objects so programmer can: Model objects in simple configurations Make multiple copies of objects Animate objects, move or deform over time

2/7/2001Hofstra University – CSC290B6 Vectors Directed line segment that connects points Does not have a fixed position

2/7/2001Hofstra University – CSC290B7 Vectors head-to-tail rule Linear independence, basis, linear maps

2/7/2001Hofstra University – CSC290B8 Geometric ADTs Scalars, Points and Vectors are members of mathematical sets Abstract spaces for representing and manipulating these sets of objects Linear Vector Space – scalars & vectors Affine Space – adds the point Euclidean Space – add concept of distance and angle

2/7/2001Hofstra University – CSC290B9 Geometric ADTs Operations that relate points and vectors Subtraction of two points yields a vector: v = P – Q Point-vector addition yields a point: P = v + Q

2/7/2001Hofstra University – CSC290B10 Geometric ADTs: Lines Consider all points of the form P (  ) = P 0 +  d where P 0 is an arbitrary point, d is an arbitrary vector, and  is a scalar P (  ) is a point for any value of  Called the parametric form of the line Generate points on the line by varying the parameter  For non-negative values, we get a ray emanating from P 0 in the direction of d

2/7/2001Hofstra University – CSC290B11 Geometric ADTs: Affine Sums For any point Q, vector v, and positive scalar , P = Q +  v describes all points on the line from Q in the direction of v Affine addition is characterized by the addition of two arbitrary points and multiplication of a point by a scalar, P =  R +  Q where  1 +  2 = 1

2/7/2001Hofstra University – CSC290B12 Geometric ADTs: Dot Product We are concerned about the orientation between two vectors Dot (Inner) Product of vectors u and v is written u  v If u  v = 0, then u and v are orthogonal In Euclidean space, the square of the magnitude of a vector is |u| 2 = u  u The angle between two vectors is given by

2/7/2001Hofstra University – CSC290B13 Geometric ADTs: Cross Product Cross Product – is determined by a third vector n that is orthogonal to two other vectors v and u. It is denoted as n = u  v

2/7/2001Hofstra University – CSC290B14 3D Primitives CurvesSurfacesVolume Objects

2/7/2001Hofstra University – CSC290B15 3D Primitves Objects With Good Characteristics Described by their surfaces; thought to be hollow Specified through a set of vertices in 3D Composed of or approximated by flat convex polygons

2/7/2001Hofstra University – CSC290B16 Coordinate Systems Given a frame ( P 0, v 1, v 2, v 3 ), a vector w: And in the same frame a point P:

2/7/2001Hofstra University – CSC290B17 Changes of Basis How do we represent the vector if we change the basis? Suppose the {v1,v2,v3} and {u1,u2,u3} are two bases. Basis vector in second set can be represented in terms of the first basis

2/7/2001Hofstra University – CSC290B18 Change of Basis in Linear Space U = MV

2/7/2001Hofstra University – CSC290B19 Change of Basis In V basis, the vector is represented by a, and in U by b U=MV, b’U=b’MV=a’V, a’=b’M, a=M’b

2/7/2001Hofstra University – CSC290B20 Homogeneous Coordinates Represent a point at ( x,y,z ) wrt a 3D frame determined by (P 0, v 1, v 2, v 3 ) with a column matrix Where x,y,z are the components of the basis vectors for this point, so that and represent a vector in the same form

2/7/2001Hofstra University – CSC290B21 Homogeneous Coordinates Maintain distinction between points and vectors Use four dimensional column matrices to represent both points and vectors in three dimensions If we assume a frame specified by ( v 1, v 2, v 3, P 0 ), then any point P can be written

2/7/2001Hofstra University – CSC290B22 Homogeneous Coordinates …and if we define multiplication of a point by the scalars 0 and 1 as 0 ·P = 0, 1. P = P, then we can use a matrix product to express this relation formally as homogeneous-coordinate representation

2/7/2001Hofstra University – CSC290B23 Homogeneous Coordinates We carry out operations on points and vectors using their homogeneous-coordinate representation and ordinary matrix algebra Point Vector

2/7/2001Hofstra University – CSC290B24 Homogeneous Coordinates All affine transformations can be represented as matrix multiplications in homogeneous coordinates two frames change of frames matrix representation

2/7/2001Hofstra University – CSC290B25 Frames In OpenGL We use two frames: the camera frame and the world frame We regard the camera frame as fixed The model-view matrix positions the world frame relative to the camera frame Perform homogeneous coordinate transformations on object in other frames to define new frames relative to the camera frame Model-view Matrix: translate along z, to separate the two frames, so object could be in camera’s field of view

2/7/2001Hofstra University – CSC290B26 Frames In OpenGL

2/7/2001Hofstra University – CSC290B27 Modeling Select modeling (local) coordiante system best suited for modeling the object Define objects in terms of vertices Pass vertices through a number of transformations using homogeneous coordinates

2/7/2001Hofstra University – CSC290B28 Affine Transformations A map f () is linear iff, for any scalars  and , and any vectors p and q, f(  p+  q) =  f(p)+  f(p) Affine maps preserve affine combinations of points f(  P+  Q) =  f(P)+  f(Q), where  +  =1  are linear in homogenious coordinates ( i.e. represented by 4x4 matrix, last row (0,0,0,1), act as matrix multiplications).  the transf. of affine combinations of points is same affine combination of the transformed points  can be represented as a composition of translations, rotations, and scalings

2/7/2001Hofstra University – CSC290B29 Transformations in Homogeneous Coordinates Each affine transformation is represented by a 4 x 4 matrix of the form

2/7/2001Hofstra University – CSC290B30 Graphics Pipeline Pipeline endpoints (in homogeneous coordinates) through affine transformations to generate the rastered image

2/7/2001Hofstra University – CSC290B31 Concatenation of Transformations We can multiply together sequences of transformations – concatenating Works well with pipeline architecture e.g., three successive transformations on a point p creates a new point q q = CBAp

2/7/2001Hofstra University – CSC290B32 Concatenation of Transformations If we have a lot of points to transform, then we can calculate M = CBA and then we use this matrix on each point q = Mp

2/7/2001Hofstra University – CSC290B33 Translation Translation is an operation that displace points by a fixed distance in a given direction Only need to specify a displacement vector d Transformed points are given by P = P + d

2/7/2001Hofstra University – CSC290B34 Translation

2/7/2001Hofstra University – CSC290B35 Rotation about a pivot point P in 2D R(P;u)=T(-P)R(O;u)T(P)

2/7/2001Hofstra University – CSC290B36 Rigid Body Transformation Rotation and translation are rigid-body transformations No combination of transformations can alter the shape of an object Non-rigid-body transformations

2/7/2001Hofstra University – CSC290B37 Scaling non-uniform uniform

2/7/2001Hofstra University – CSC290B38 Rotation About Axis Parrallel to z-axis Move the cube to the origin Apply R z (  ) Move back to original position

2/7/2001Hofstra University – CSC290B39 Instance Transformation object prototype instance

2/7/2001Hofstra University – CSC290B40 Instance Transformation

2/7/2001Hofstra University – CSC290B41 Current Transformation Matrix Current Transformation Matrix (CTM) – matrix that is applied to any vertex that is defined subsequent to setting the CTM Changing the CTM, alters the state of the system 4x4 matrix that can be altered by a set of functions provided by the graphics package Common to most systems. Part of the pipeline If p is a vertex, the pipeline produces Cp

2/7/2001Hofstra University – CSC290B42 Current Transformation Matrix Let C denote the CTM. It is set to the 4x4 identity matrix, initially. The symbol  denotes replacement Initialization operation: C  I Three transformations about the fixed point of the origin: translation, rotation, scaling Set:Postmultiplication: C  TC  CT C  RC  CR C  S C  CS

2/7/2001Hofstra University – CSC290B43 Current Transformation Matrix The matrix the is applied to all primitives is the product of the model-view matrix ( GL_MODELVIEW ) and the projection matrix ( GL_PROJECTION ) The CTM is the product of these matrices!

2/7/2001Hofstra University – CSC290B44 Current Transformation Matrix The matrix that is applied to all primitives is the product of the model-view matrix ( GL_MODELVIEW ) and the projection matrix ( GL_PROJECTION ) The CTM is the product of these matrices We select the desired matrix of each with glMatrixMode then alter the selected matrix through postmultiplication using: glLoadIdentity( ); glRotatef(angle, vx, vy, vz); glTranslatef(dx, dy, dz); glScalef(sx, sy, sz);

2/7/2001Hofstra University – CSC290B45 Order of Transformations Transformation specified most recently is the one applied first glMatrixModel(GL_MODELVIEW) glLoadIdentity( ); glTranslatef(4.0, 5.0, 6.0); glRotatef(45.0, 1.0, 2.0, 3.0); glTranslatef(-4.0, -5.0, -6.0);

2/7/2001Hofstra University – CSC290B46 Summary: Affine Maps Composition of translations, rotations, scalings Preserve affine combination of points If object is modeled as affine combination from vertices, under affine map, the transformed object is the same affine combination of the transformed vertices.

2/7/2001Hofstra University – CSC290B47 Summary: Affine Maps Liner maps in homogeneous coordinates, represented by matrices Composition of affine maps is represented by a matrix which is product of the matrices of the individual maps.

2/7/2001Hofstra University – CSC290B48 Fundamental Operations Transformation – changes in coordinate systems through matrix operations Clipping – adjusting our view of the world Projection – from 3D to 2D Rasterization – pixels in the frame buffer