16/5/2016 02:47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function.

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.
Geometric Transformations
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Math 1Hofstra University – CSC171A1 Modeling Objects by Polygonal Approximations Define volumetric objects in terms of surfaces patches that surround the.
Geometry (Many slides adapted from Octavia Camps and Amitabh Varshney)
2/7/2001Hofstra University – CSC290B1 Review: Math (Ch 4)
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.
Transformations Objectives Understand how transformations work in 2D and 3D Understand the concept of homogenous coordinate system Understand scene graphs.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
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.
Linear Algebra Review CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Geometric Objects and Transformations Chapter 4. Points, Scalars and Vectors  Points - position in space  Scalars - real numbers, complex numbers obey.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
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.
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.
OpenGL Matrices and Transformations Angel, Chapter 3 slides from AW, Red Book, etc. CSCI 6360.
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
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Geometric Objects and Transformation
1 Computer Graphics Week9 -3D Geometric Transformation.
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.
CAP 4730 Computer Graphic Methods Prof. Roy Levow Chapter 4.
CSE Real Time Rendering Week 5. Slides(Some) Courtesy – E. Angel and D. Shreiner.
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate 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.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Learning Objectives Affine transformations Affine transformations Translation Translation Rotation Rotation Scaling Scaling Reflection Reflection Shear.
1 By Dr. HANY ELSALAMONY.  We have seen how to create models in the 3D world. We discussed transforms in lecture 3, and we have used some transformations.
Homogeneous Coordinates and Matrix Representations Cartesian coordinate (x, y, z) Homogeneous coordinate (x h, y h, z h, h) Usually h = 1. But there are.
Geometric Transformations. Transformations Linear transformations Rigid transformations Affine transformations Projective transformations T Global reference.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
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 고려대학교 컴퓨터 그래픽스 연구실.
Transformations. Transformations Introduce standard transformations ◦ Rotation ◦ Translation ◦ Scaling ◦ Shear Derive homogeneous coordinate transformation.
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.
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
Objectives Introduce standard transformations Introduce standard transformations Derive homogeneous coordinate transformation matrices Derive homogeneous.
Unit-4 Geometric Objects and Transformations- I
Geometric Transformations
Transformations Objectives
Review: Transformations
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:

16/5/ :47 UML Computer Graphics Conceptual Model Application Model Application Program Graphics System Output Devices Input Devices API Function Calls or Protocol Data

26/5/ :47 UML Modeling in Three Dimensions Two Approaches 0 Constructive Solid Geometry (CSG) -Primitives are a small set of volumetric objects such as cube, pyramid, sphere, etc. -Objects built from normalized set operations on these objects 0 Boundary (surface) representation -Objects are described by their surfaces and can be thought of as being hollow -Surfaces composed (approximated) by simple, convex, planar polygons -Objects can be specified through a set of vertices in three dimensions =Implies underlying coordinate system =Duality: Object Object representation

36/5/ :47 UML Representation of a Cube Surface Representation Data Structure X 0, Y 0, Z 0 X 1, Y 1, Z 1 X 2, Y 2, Z 2 X 3, Y 3, Z 3 X 4, Y 4, Z 4 X 5, Y 5, Z 5 X 6, Y 6, Z 6 X 7, Y 7, Z A B C D E F FACES VERTEX LISTS VERTICES Object: set of points Representation: data structure

46/5/ :47 UML Inward and Outward Pointing Faces: Right Hand Rule Outside

56/5/ :47 UML Transformations 0 Maps an object into another object -In general, a transformation maps every point on an object to another point in the underlying coordinate space. 0 Why do we want/need transformations? -Change size, location, orientation of objects without changing underlying model (or primitive drawing commands) -Animation -Instancing Object New Object Representation New Representation Transformation Operation

66/5/ :47 UML P1’P1’ P2’P2’ What Do We Require of Transforms? Line Preserving P1P1 P2P2 Line Not Preserved

76/5/ :47 UML Abstract Data Types: Affine Space  Scalar  -Magnitude (e.g. real numbers)  Vector u, v, w, x -Direction -Magnitude -No Position  Point P, Q, R, X -Position -No Direction -No Magnitude

86/5/ :47 UML Defined Operations: Scalars  Addition:  -Additive identity: zero  Additive inverse: -  -Subtraction defined in terms of additive inverse  Multiplication:  -Multiplicative identity: 1  Multiplicative inverse: 1/  -Division defined in terms of multiplicative inverse

96/5/ :47 UML Defined Operations: Vectors Addition u v u + v | u | =  Magnitude (produces scalar) Dot Product  u v u  v = | u | | v | cos  (produces scalar) Cross Product  u v Produces vector w orthogonal to u and v. w = u x v | w | = | u | | v | sin 

106/5/ :47 UML Defined Operations: Scalars and Vectors Multiplication of vector by scalar: Produces vector u v =  u |  u | =  | u |

116/5/ :47 UML Defined Operations: Points and Vectors Affine Addition: Point + Vector = Point P Q v Q = P + v Related to point subtraction.

126/5/ :47 UML Defined Operations: Points Subtraction (Addition of points has no meaning.) P R u = P - R Produces vector

136/5/ :47 UML Lines in Affine Space P Q v Q = P + v R R = P +  v  R’ Line segment from P to Q defined when: 0  1

146/5/ :47 UML Planes in Affine Space Planes are defined uniquely by three points: P, Q, R P Q R u v T(  ) S(  ) S(  ) = P +  v T(  ) = P +  u W(  ) = S + (T - S) = P +  v +  u -  v) W (  ) = P +  1 -  v +  u W = P +  v +  u W( ) u = Q - P v = R - P

156/5/ :47 UML Representations of Points and Vectors Coordinate system: z y x v P (x, y, z) where:

166/5/ :47 UML Homogeneous Coordinates Frame is specified by: Homogeneous coordinate representation: Frame where are linearly independent basis vectors and P 0 arbitrary point

176/5/ :47 UML Representation of Vectors In Homogeneous Coordinates

186/5/ :47 UML Affine Addition In Homogeneous Coordinate Representation Point Scalar times vector

196/5/ :47 UML Transform as a Change of Frame y x y x (2, 3) Want to translate by:  x = 2  y=4 (2, 3) in x’y’ (4,7) in x y y’ x’ 1. Transform frame 2. Find representation in original frame  x = 2  y=4

206/5/ :47 UML Transform as a Change of Frame Representation: Frame:

216/5/ :47 UML Transformation Matrix Original Frame:Transformed Frame: Express elements of transformed frame in original frame: where:

226/5/ :47 UML Transformation of Representation is representation in transformed frame is representation in original frame where is of the form:

236/5/ :47 UML Affine Transformations T(point) -> point T(vector) -> vector

246/5/ :47 UML P1’P1’ P2’P2’ What Do We Require of Transforms? Line Preserving P1P1 P2P2 Line Not Preserved

256/5/ :47 UML Affine Transformation: Line Preservation Matrix multiplication is linear. Therefore: p p+vp+v v T(p) T(p)+  T(v) T(v) Meets our requirements!

266/5/ :47 UML Translation Translate the new frame: Assumptions:

276/5/ :47 UML Scaling Scale the new frame:

286/5/ :47 UML Rotation Rotation around the z axis: 

296/5/ :47 UML Rotation About x and y axes Similar derivations give:

306/5/ :47 UML Concatenation of Transformations Apply T 1, Then apply T 2 :

316/5/ :47 UML OpenGL Matrix Operations glLoadIdentity(); Loads an identity matrix onto the top of the current stack glLoadMatrixf(pointer_to_matrix); Loads arbitrary matrix onto top of the current stack glMultMatrixf(pointer_to_matrix); Postmultiplies current matrix by arbitrary matrix Matricies are one-dimensional arrays of type GLfloat in column major order.

326/5/ :47 UML Predefined Postmultiplier Operators in OpenGL glTranslatef(dx, dy, dz); Multiplies current matrix with translation matrix. dx, dy, and dz are translations along x,y, and z axes. glRotatef(angle, x, y, z); Multiplies current matrix with rotation about the line from the origin through the point (x, y, z) by angle. Right hand rule applies. Angle in degrees. glScalef(sx, sy, sz); Multiplies current matrix with scaling matrix. sx, sy, sz are the scale factors along the x, y, and z axes.

336/5/ :47 UML Transformation Matrices in OpenGL Stack Current Stack CurrentLoad Matrix Vertices 3D Model Vertices 3D 2D ModelviewProjection Matrix Mode