Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Similar documents
CS452/552; EE465/505. Geometry Transformations

Geometry. Prof. George Wolberg Dept. of Computer Science City College of New York

Transformations. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

Geometry. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

BASIC ELEMENTS. Geometry is the study of the relationships among objects in an n-dimensional space

Objectives. Geometry. Basic Elements. Coordinate-Free Geometry. Transformations to Change Coordinate Systems. Scalars

Objectives. Geometry. Coordinate-Free Geometry. Basic Elements. Transformations to Change Coordinate Systems. Scalars

Geometry. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Lecture 9: Transformations. CITS3003 Graphics & Animation

Computer Graphics. Coordinate Systems and Change of Frames. Based on slides by Dianna Xu, Bryn Mawr College

Lecture 4: Transformations and Matrices. CSE Computer Graphics (Fall 2010)

Transformations. Overview. Standard Transformations. David Carr Fundamentals of Computer Graphics Spring 2004 Based on Slides by E.

CS 432 Interactive Computer Graphics

Transformations. Prof. George Wolberg Dept. of Computer Science City College of New York

Computer Graphics with OpenGL ES (J. Han) Chapter IV Spaces and Transforms

EECE 478. Learning Objectives. Learning Objectives. Linear Algebra and 3D Geometry. Linear algebra in 3D. Coordinate systems

Today s Agenda. Geometry

Representations and Transformations. Objectives

Transformations. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Geometric transformations assign a point to a point, so it is a point valued function of points. Geometric transformation may destroy the equation

Objectives. transformation. General Transformations. Affine Transformations. Notation. Pipeline Implementation. Introduce standard transformations

Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

UNIT 2 2D TRANSFORMATIONS

Introduction to Computer Graphics with WebGL

Overview. By end of the week:

Transformations. Standard Transformations. David Carr Virtual Environments, Fundamentals Spring 2005 Based on Slides by E. Angel

CS 130 Final. Fall 2015

Last week. Machiraju/Zhang/Möller/Fuhrmann

Vector Algebra Transformations. Lecture 4

Three Main Themes of Computer Graphics

Viewing with Computers (OpenGL)

COMP3421. Week 2 - Transformations in 2D and Vector Geometry Revision

Fall CSCI 420: Computer Graphics. 2.2 Transformations. Hao Li.

DRAFT: Mathematical Background for Three-Dimensional Computer Graphics. Jonathan R. Senning Gordon College

GEOMETRIC TRANSFORMATIONS AND VIEWING

Today. Today. Introduction. Matrices. Matrices. Computergrafik. Transformations & matrices Introduction Matrices

Last week. Machiraju/Zhang/Möller

3D Viewing Episode 2

Figure 1. Lecture 1: Three Dimensional graphics: Projections and Transformations

3D GRAPHICS. design. animate. render

3D Viewing Episode 2

The Importance of Matrices in the DirectX API. by adding support in the programming language for frequently used calculations.

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Rational Numbers: Graphing: The Coordinate Plane

Vector Calculus: Understanding the Cross Product

GEOMETRIC OBJECTS AND TRANSFORMATIONS I

Computer Graphics 7: Viewing in 3-D

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

Introduction to Homogeneous coordinates

Homogeneous coordinates, lines, screws and twists

Graphics pipeline and transformations. Composition of transformations

CS452/552; EE465/505. Transformations

CSE528 Computer Graphics: Theory, Algorithms, and Applications

THE VIEWING TRANSFORMATION

3D Mathematics. Co-ordinate systems, 3D primitives and affine transformations

Mathematics (

COMP3421. Week 2 - Transformations in 2D and Vector Geometry Revision

Visualisation Pipeline : The Virtual Camera

CS251 Spring 2014 Lecture 7

The Rectangular Coordinate System and Equations of Lines. College Algebra

Game Architecture. 2/19/16: Rasterization

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

For each question, indicate whether the statement is true or false by circling T or F, respectively.

CS Exam 1 Review Problems Fall 2017

Computer Graphics. Lecture 2. Doç. Dr. Mehmet Gokturk

MET71 COMPUTER AIDED DESIGN

Graphics Pipeline 2D Geometric Transformations

2D Object Definition (1/3)

Transformations Computer Graphics I Lecture 4

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

Ray Tracer I: Ray Casting Due date: 12:00pm December 3, 2001

Lecture 6 Sections 4.3, 4.6, 4.7. Wed, Sep 9, 2009

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

Answers. Chapter 2. 1) Give the coordinates of the following points:

Coordinate Transformations & Homogeneous Coordinates

Computer Graphics: Viewing in 3-D. Course Website:

Geometric Algebra. 8. Conformal Geometric Algebra. Dr Chris Doran ARM Research

2009 GCSE Maths Tutor All Rights Reserved

CSC 305 The Graphics Pipeline-1

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

Quaternion Rotations AUI Course Denbigh Starkey

The Three Dimensional Coordinate System

Rasterization Overview

CS354 Computer Graphics Rotations and Quaternions

Specifying Complex Scenes

Basics of Computational Geometry

Overview. Viewing and perspectives. Planar Geometric Projections. Classical Viewing. Classical views Computer viewing Perspective normalization

Transformations. CSCI 420 Computer Graphics Lecture 4

Lesson 20: Exploiting the Connection to Cartesian Coordinates

Fundamental Types of Viewing

Isometries. 1 Identifying Isometries

Transformations Computer Graphics I Lecture 4

Transformations: 2D Transforms

CS354 Computer Graphics Viewing and Modeling

CS 563 Advanced Topics in Computer Graphics. by Emmanuel Agu

Transcription:

Basic Elements Geometry is the study of the relationships among objects in an n-dimensional space In computer graphics, we are interested in objects that exist in three dimensions We want a minimum set of primitives from which we can build more sophisticated objects We will need three basic elements Scalars Vectors Points

Coordinate-Free Geometry When we learned simple geometry, most of us started with a Cartesian approach Points were at locations in space p=(x,y,z) We derived results by algebraic manipulations involving these coordinates This approach was nonphysical Physically, points exist regardless of the location of an arbitrary coordinate system Most geometric results are independent of the coordinate system Example Euclidean geometry: two triangles are identical if two corresponding sides and the angle between them are identical

Vectors Physical definition: a vector is a quantity with two attributes Direction Magnitude Examples include Force Velocity Directed line segments Most important example for graphics Can map to other types v

Vector Operations Every vector has an inverse Same magnitude but points in opposite direction Every vector can be multiplied by a scalar There is a zero vector Zero magnitude, undefined orientation The sum of any two vectors is a vector Use head-to-tail axiom v -v v v w u

Vectors Lack Position These vectors are identical Same length and magnitude Vectors spaces insufficient for geometry Need points

Points Location in space Operations allowed between points and vectors Point-point subtraction yields a vector Equivalent to point-vector addition v=p-q P=v+Q

Planes A plane can be defined by a point and two vectors or by three points P v Q R u R

Normals Every plane has a vector n normal (perpendicular, orthogonal) to it We can use the cross product to find n = u v v P u

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

Frames A coordinate system is insufficient to represent points We can add a single point, the origin, to the basis vectors to form a frame v 2 P v 1 v 3

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

A Single Representation If we define P = and 1 P =P then we can write v= 1 v 1 + 2 v 2 + 3 v 3 = [ 1 2 3 ] [v 1 v 2 v 3 P ] T P = P + b 1 v 1 + b 2 v 2 +b 3 v 3 = [b 1 b 2 b 3 1 ] [v 1 v 2 v 3 P ] T Thus we obtain the four-dimensional homogeneous coordinate representation v = [ 1 2 3 ] T p = [b 1 b 2 b 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) by xx /w yy /w zz /w If w=, 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= for vectors and w=1 for points

The World and Camera Frames 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 modelview matrix Initially these frames are the same (M=I)

Transformations A transformation maps points to other points and/or vectors to other vectors Importance in graphics is that we need only transform endpoints of line segments and let implementation draw line segment between the transformed endpoints Q=T(P) v=t(u)

Pipeline Implementation T (from application program) u T(u) frame buffer v transformation T(v) rasterization T(v) v T(v) T(u) u T(u) vertices vertices pixels

Translation Move (translate, displace) a point to a new location P P d Displacement determined by a vector d P =P+d

Translation Using Representations Using the homogeneous coordinate representation in some frame p=[ x y z 1] T p =[x y z 1] T d=[dx dy dz ] T Hence p = p + d or x =x+d x y =y+d y z =z+d z note that this expression is in four dimensions and expresses point = vector + point

Translation Matrix We can also express translation using a 4 x 4 matrix T in homogeneous coordinates p =Tp where T = T(d x, d y, d z ) = 1 1 This form is better for implementation because all transformations can be expressed this way and multiple transformations can be concatenated together 1 d d d x y z 1

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

Rotation (2D) Consider rotation about the origin by q degrees radius stays the same, angle increases by q x = r cos (f + q) y = r sin (f + q) x =x cos q y sin q y = x sin q + y cos q x = r cos f y = r sin f

Rotation about the z axis Rotation about z axis in three dimensions leaves all points with the same z Equivalent to rotation in two dimensions in planes of constant z x =x cos q y sin q y = x sin q + y cos q z =z or in homogeneous coordinates p =R z (q)p R = R z (q) = cos sin q q sin q cos q 1 1

Rotation about x and y axes Same argument as for rotation about z axis For rotation about x axis, x is unchanged For rotation about y axis, y is unchanged R = R x (q) = R = R y (q) = q q q q 1 cos sin - sin cos 1 q q q q 1 cos - sin 1 sin cos

Scaling 1 z y x s s s S = S(s x, s y, s z ) = x =s x x y =s y y z =s z z p =Sp Expand or contract along each axis (fixed point of origin)

Reflection corresponds to negative scale factors s x = -1 s y = 1 original s x = -1 s y = -1 s x = 1 s y = -1

Inverses Although we could compute inverse matrices by general formulas, we can use simple geometric observations Translation: T -1 (d x, d y, d z ) = T(-d x, -d y, -d z ) Rotation: R -1 (q) = R(-q) Holds for any rotation matrix Note that since cos(-q) = cos(q) and sin(-q)=-sin(q) R -1 (q) = R T (q) Scaling: S -1 (s x, s y, s z ) = S(1/s x, 1/s y, 1/s z )