1 CS 430/536 Computer Graphics I 3D Transformations World Window to Viewport Transformation Week 2, Lecture 4 David Breen, William Regli and Maxim Peysakhov.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

Transformations Ed Angel Professor Emeritus of Computer Science
COMPUTER GRAPHICS 2D TRANSFORMATIONS.
Computer Graphics Lecture 4 Geometry & Transformations.
Geometric Transformations
John C. Hart CS 318 Interactive Computer Graphics
Three Dimensional Modeling Transformations
David Breen, William Regli and Maxim Peysakhov
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Transformations II Week.
1 Geometrical Transformation 2 Outline General Transform 3D Objects Quaternion & 3D Track Ball.
2D Geometric Transformations
Computer Graphics Recitation 2. 2 The plan today Learn about rotations in 2D and 3D. Representing rotations by quaternions.
3D Coordinate Systems and Transformations Revision 1
3D orientation.
CSCE 689: Computer Animation Rotation Representation and Interpolation
CSCE 441: Computer Graphics Rotation Representation and Interpolation
CSCE 641: Computer Graphics Rotation Representation and Interpolation Jinxiang Chai.
Math for CSLecture 11 Mathematical Methods for Computer Science Lecture 1.
Transformations I CS5600Computer Graphics by Rich Riesenfeld 27 February 2002 Lecture Set 5.
Transformations CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
3D Graphics Goal: To produce 2D images of a mathematically described 3D environment Issues: –Describing the environment: Modeling (mostly later) –Computing.
Computer Graphics 3D Transformations. 3D Translation Remembering 2D transformations -> 3x3 matrices, take a wild guess what happens to 3D transformations.
10/5/04© University of Wisconsin, CS559 Fall 2004 Last Time Compositing Painterly Rendering Intro to 3D Graphics Homework 3 due Oct 12 in class.
UNIT - 5 3D transformation and viewing. 3D Point  We will consider points as column vectors. Thus, a typical point with coordinates (x, y, z) is represented.
CS 450: COMPUTER GRAPHICS 3D TRANSFORMATIONS SPRING 2015 DR. MICHAEL J. REALE.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1
1 Kinematics ( 運動學 ) Primer Jyun-Ming Chen Fall 2009.
1 CS 430/536 Computer Graphics I Circle Drawing and Clipping Week 3, Lecture 6 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 480/680 Computer Graphics Transformations Dr. Frederick C Harris, Jr.
Computer Graphics Bing-Yu Chen National Taiwan University.
Geometric Transformations Jehee Lee Seoul National University.
2003CS Hons RW778 Graphics1 Chapter 5: Transforming Objects 5.2 Introduction to Transformations 5.2 Introduction to Transformations –Affine transformations.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Transformations of Objects – 2D Part I.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
1 CS 430/536 Computer Graphics I Line Drawing Week 1, Lecture 2 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing Laboratory.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
Rick Parent - CIS681 ORIENTATION Use Quaternions Interpolating rotations is difficult.
CS 325 Introduction to Computer Graphics 02 / 17 / 2010 Instructor: Michael Eckmann.
Advanced Computer Graphics Spring 2014
1 Fundamentals of Robotics Linking perception to action 2. Motion of Rigid Bodies 南台科技大學電機工程系謝銘原.
Transformations Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Jinxiang Chai Composite Transformations and Forward Kinematics 0.
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
1 CS 430/536 Computer Graphics I Curve Drawing Algorithms Week 4, Lecture 8 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing.
Transformational Geometry CS418 Computer Graphics John C. Hart.
SE 313 – Computer Graphics Lecture 8: Transformations and Projections Lecturer: Gazihan Alankuş 1.
CS 325 Introduction to Computer Graphics 02 / 26 / 2010 Instructor: Michael Eckmann.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
2/19/04© University of Wisconsin, CS559 Spring 2004 Last Time Painterly rendering 2D Transformations –Transformations as coordinate system changes –Transformations.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
Geometric Transformations Sang Il Park Sejong University Many slides come from Jehee Lee’s.
Composite 3D Transformations. Example of Composite 3D Transformations Try to transform the line segments P 1 P 2 and P 1 P 3 from their start position.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
Affine Geometry.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 3: Transformations 1
1 CS 430/536 Computer Graphics I B-Splines and NURBS Week 5, Lecture 9 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
Computer Graphics I, Fall 2010 Transformations.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
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,
CPSC 641: Computer Graphics Rotation Representation and Interpolation
CS 445 / 645 Introduction to Computer Graphics
CENG 477 Introduction to Computer Graphics
Geometric Transformations for Computer Graphics
CSCE441: Computer Graphics 2D/3D Transformations
Presentation transcript:

1 CS 430/536 Computer Graphics I 3D Transformations World Window to Viewport Transformation Week 2, Lecture 4 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing Laboratory Department of Computer Science Drexel University

2 Outline World window to viewport transformation 3D transformations Coordinate system transformation

3 The Window-to-Viewport Transformation Problem: Screen windows cannot display the whole world (window management) How to transform and clip: Objects to Windows to Screen Pics/Math courtesy of Dave UMD-CP

4 Window-to-Viewport Transformation Given a window and a viewport, what is the transformation from WCS to VPCS? Three steps: Translate Scale Translate 1994 Foley/VanDam/Finer/Huges/Phillips ICG

5 Transforming World Coordinates to Viewports 3 steps 1.Translate 2.Scale 3.Translate Overall Transformation: 1994 Foley/VanDam/Finer/Huges/Phillips ICG

6 Clipping to the Viewport Viewport size may not be big enough for everything Display only the pixels inside the viewport Transform lines in world Then clip in world Transform to image Then draw Do not transform pixels 1994 Foley/VanDam/Finer/Huges/Phillips ICG

7 Another Example Scan-converted –Lines –Polygons –Text –Fill regions Clip regions for display 1994 Foley/VanDam/Finer/Huges/Phillips ICG

8 Raster and Pixel Clipping Pics/Math courtesy of Dave UMD-CP x min  x  x max y min  y  y max (x max,y max ) (x min,y min )

9 3D Transformations

10 Representation of 3D Transformations Z axis represents depth Right Handed System –When looking “down” at the origin, positive rotation is CCW Left Handed System –When looking “down”, positive rotation is in CW –More natural interpretation for displays, big z means “far” (into screen) 1994 Foley/VanDam/Finer/Huges/Phillips ICG

11 3D Homogenous Coordinates Homogenous coordinates for 2D space requires 3D vectors & matrices Homogenous coordinates for 3D space requires 4D vectors & matrices [x,y,z,w]

12 3D Transformations: Scale & Translate Scale –Parameters for each axis direction Translation

13 3D Transformations: Rotation One rotation for each world coordinate axis

14 Rotation Around an Arbitrary Axis Rotate a point P around axis n (x,y,z) by angle  c = cos(  ) s = sin(  ) t = (1 - c) Graphics Gems I, p. 466 & 498

Also can be expressed as the Rodrigues Formula 15 Rotation Around an Arbitrary Axis

Improved Rotations Euler Angles have problems –How to interpolate keyframes? –Angles aren’t independent –Interpolation can create Gimble Lock, i.e. loss of a degree of freedom when axes align Solution: Quaternions! 16

17

18

19

20

21

22 slerp – Spherical linear interpolation Need to take equals steps on the sphere A & B are quaternions

What about interpolating multiple keyframes? Shoemake suggests using Bezier curves on the sphere Offers a variation of the De Casteljau algorithm using slerp and quaternion control points See K. Shoemake, “Animating rotation with quaternion curves”, Proc. SIGGRAPH ’85 23

24 3D Transformations: Reflect & Shear Reflection: about x-y plane Shear: (function of z)

25 3D Transformations: Shear

26 Example Pics/Math courtesy of Dave UMD-CP

27 Example: Composition of 3D Transformations Goal: Transform P 1 P 2 and P 1 P Foley/VanDam/Finer/Huges/Phillips ICG

28 Example (Cont.) Process 1.Translate P 1 to (0,0,0) 2.Rotate about y 3.Rotate about x 4.Rotate about z (1) (2-3) (4) 1994 Foley/VanDam/Finer/Huges/Phillips ICG

29 Final Result What we’ve really done is transform the local coordinate system R x, R y, R z to align with the origin x,y,z 1994 Foley/VanDam/Finer/Huges/Phillips ICG

30 Example 2: Composition of 3D Transformations Airplane defined in x,y,z Problem: want to point it in Dir of Flight (DOF) centered at point P Note: DOF is a vector Process: –Rotate plane –Move to P 1994 Foley/VanDam/Finer/Huges/Phillips ICG

31 Example 2 (cont.) Z p axis to be DOF X p axis to be a horizontal vector perpendicular to DOF – y x DOF Y p, vector perpendicular to both Z p and X p (i.e. Z p x X p ) 1994 Foley/VanDam/Finer/Huges/Phillips ICG

32 Transformations to Change Coordinate Systems Issue: the world has many different relative frames of reference How do we transform among them? Example: CAD Assemblies & Animation Models

33 Transformations to Change Coordinate Systems 4 coordinate systems 1 point P 1994 Foley/VanDam/Finer/Huges/Phillips ICG

34 Coordinate System Example (1) Translate the House to the origin 1994 Foley/VanDam/Finer/Huges/Phillips ICG The matrix M ij that maps points from coordinate system j to i is the inverse of the matrix M ji that maps points from coordinate system j to coordinate system i. P1P1

35 Coordinate System Example (2) Transformation Composition: 1994 Foley/VanDam/Finer/Huges/Phillips ICG

36 World Coordinates and Local Coordinates To move the tricycle, we need to know how all of its parts relate to the WCS Example: front wheel rotates on the ground wrt the front wheel’s z axis: Coordinates of P in wheel coordinate system: 1994 Foley/VanDam/Finer/Huges/Phillips ICG

37 Questions about Homework 1? Go to web site