Ta: Ryan Freedman Sushma Kini Chi Zhou.  Pipeline  Clipping  Transformation, homogeneous coordinates  Lighting  Perspective  Viewing.

Slides:



Advertisements
Similar presentations
Graphics Pipeline.
Advertisements

Computer Graphics Lecture 8 Arbitrary Viewing II: More Projection, Clipping and Mathematics of 3D Viewing.
1 Computer Graphics Chapter 8 3D Transformations.
Three Dimensional Modeling Transformations
CS 551 / 645: Introductory Computer Graphics Clipping Lines and Polygons.
CMPE 466 COMPUTER GRAPHICS Chapter 8 2D Viewing Instructor: D. Arifler Material based on - Computer Graphics with OpenGL ®, Fourth Edition by Donald Hearn,
Informationsteknologi Wednesday, November 7, 2007Computer Graphics - Class 51 Today’s class Geometric objects and transformations.
Informationsteknologi Thursday, November 22, 2007Computer Graphics - Class 111 Today’s class Clipping Parametric and point-normal form of lines Intersecting.
Objectives Derive the perspective projection matrices used for standard OpenGL projections Derive the perspective projection matrices used for standard.
CS 376 Introduction to Computer Graphics 02 / 26 / 2007 Instructor: Michael Eckmann.
Lecture 3 – Transformation And Coordinate Systems
Viewing Doug James’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals of Computer Graphics, Chap 7 Wen-Chieh (Steve) Lin Institute of Multimedia.
CAP4730: Computational Structures in Computer Graphics
2D Transformations. World Coordinates Translate Rotate Scale Viewport Transforms Hierarchical Model Transforms Putting it all together.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
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.
Mathematical Fundamentals
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
CS 325 Introduction to Computer Graphics 03 / 03 / 2010 Instructor: Michael Eckmann.
2-Dimension Viewing and Clipping
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
2.2 Linear Transformations in Geometry For an animation of this topic visit
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
CS 376 Introduction to Computer Graphics 02 / 12 / 2007 Instructor: Michael Eckmann.
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
Advanced Computer Graphics Three Dimensional Viewing
Week 2 - Wednesday CS361.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
Week 5 - Wednesday.  What did we talk about last time?  Project 2  Normal transforms  Euler angles  Quaternions.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS 325 Introduction to Computer Graphics 02 / 17 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Geometric Objects and Transformation
1 Computer Graphics Week9 -3D Geometric Transformation.
Programming 3D Applications CE Displaying Computer Graphics Week 3 Lecture 5 Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
Transformational Geometry CS418 Computer Graphics John C. Hart.
Viewing CS418 Computer Graphics John C. Hart. Graphics Pipeline Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords.
Introduction to 3D Graphics Lecture 2: Mathematics of the Simple Camera Anthony Steed University College London.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
©2005, Lee Iverson Lee Iverson UBC Dept. of ECE EECE 478 Viewing and Projection.
Properties or Rules of Transformations Equations used to find new locations.
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
3D Transformation A 3D point (x,y,z) – x,y, and z coordinates
3-D Transformational Geometry CS418 Computer Graphics John C. Hart.
Introduction to Computer Graphics: Viewing Transformations Rama C
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
Digital Image Processing Additional Material : Imaging Geometry 11 September 2006 Digital Image Processing Additional Material : Imaging Geometry 11 September.
Honors Geometry.  We learned how to set up a polygon / vertex matrix  We learned how to add matrices  We learned how to multiply matrices.
Jinxiang Chai CSCE441: Computer Graphics 3D Transformations 0.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
CS 551 / 645: Introductory Computer Graphics Viewing Transforms.
Analytic geometry refreshment Szirmay-Kalos László.
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.
CS552: Computer Graphics Lecture 12: 3D Clipping.
CS 418 : EXAM 2 REVIEW TA: Ryan Freedman Sushma Kini Chi Zhou.
Computer Graphic 2 D Viewing.
CS418 Computer Graphics John C. Hart
University of North Carolina at Greensboro
Computer Graphics CC416 Week 15 3D Graphics.
Transformations contd.
CENG 477 Introduction to Computer Graphics
Projection in 3-D Glenn G. Chappell
CS1550 Fundamentals For Computer Graphics Transformations-2
THREE-DIMENSIONAL VIEWING
Clipping Clipping Sutherland-Hodgman Clipping
컴퓨터 그래픽스를 위한 기하학적 기초 (Line Geometry for Computer Graphics)
Presentation transcript:

Ta: Ryan Freedman Sushma Kini Chi Zhou

 Pipeline  Clipping  Transformation, homogeneous coordinates  Lighting  Perspective  Viewing

Homogeneous Divide Model Coords Model Xform World Coords Viewing Xform Still Clip Coords. Clipping Window Coordinates Window Coordinates Window to Viewport Window to Viewport Coordinates Viewport Coordinates Clip Coords. Viewing Coords Perspective Distortion

 Serial  Parametric  Polygon  Concave  3-D

 First clip 0001  Move (x 0,y 0 ) to (left,…)  Then clip 0010  Move (x 1,y 1 ) to (right,…)  Then clip 0100  Move (x 0,y 0 ) again, now to (…,bottom)  Finally clip 1000  Move (x 1,y 1 ) again, now to (…,top) y = top y = bottom x = leftx = right

 Compute ordered list of t-intersections 0 < t left < t bottom < t top < t right < 1  And corresponding orientations enter, enter, leave, leave (x0,y0)(x0,y0) (x1,y1)(x1,y1) t left = (left – x 0 ) / (x 1 – x 0 ) t right = -(right – x 0 ) / -(x 1 – x 0 ) t bottom = (bottom – y 0 ) / (y 1 – y 0 ) t top = -(top – y 0 ) / -(y 1 – y 0 ) y = top y = bottom x = leftx = right enter leave enter leave

 Compute ordered list of t-intersections 0 < t left < t bottom < t top < t right < 1  And corresponding orientations enter, enter, leave, leave  Keep only the pair (x0,y0)(x0,y0) (x1,y1)(x1,y1) t left = (left – x 0 ) / (x 1 – x 0 ) t right = -(right – x 0 ) / -(x 1 – x 0 ) t bottom = (bottom – y 0 ) / (y 1 – y 0 ) t top = -(top – y 0 ) / -(y 1 – y 0 ) y = top y = bottom x = leftx = right enter leave

 Sutherland-Hodgman  Polygon ABC  Clip left: A 1 BCA 2  Clip right: A 1 B 1 B 2 CA 2  Clip bottom: A 1 B 1 ’B 2 ’CA 2  Clip top: A 1 B 1 ’B 2 ’C 1 C 2 A 2 y = top y = bottom x = leftx = right A 1’ B 1’ C A2A2 B2B2 A1A1 B1B1 C1C1 C2C2

 Sutherland-Hodgman  Clip segments even if they are trivially rejectible  Outputs a single polygon that appears as multiple polygons  Reversed edges don’t get filled

 Need to keep depth (z-coordinate) of geometry for visible surface detection  Generalize oriented screen edge to oriented clipping plane C = (A,B,C,D)  Then any homogeneous point P = (x,y,z,w) T classified as  “on” if C P = 0  “in” if C P > 0  “out” if C P < 0 left right bottom top near far Ax + By + Cz + D = 0  wAx + wBy + wCz + wD = 0 (A,B,C)(A,B,C)

Recall that a 2-D parametric line segment from (x 0,y 0 ) to (x 1,y 1 ) is described by the equations x(t) = x 0 + t(x 1 – x 0 ) and y(t) = y 0 + t(y 1 – y 0 ), and recall the clipping window extends from (-1,-1) to (1,1). What are the (x,y) coordinates of the two points where the line segment from (-4,-1) to (3,2) intersects the clipping boundary? (Hint: we know that it goes through the left boundary)

Recall that a 2-D parametric line segment from (x 0,y 0 ) to (x 1,y 1 ) is described by the equations x(t) = x 0 + t(x 1 – x 0 ) and y(t) = y 0 + t(y 1 – y 0 ), and recall the clipping window extends from (-1,-1) to (1,1). What are the (x,y) coordinates of the two points where the line segment from (-4,-1) to (3,2) intersects the clipping boundary? x(t) = -4 + t(3 - -4) = 7t – 4 y(t) = -1 + t(2 - -1) = 3t – 1 When x = -1: t = 3/7, y = 9/7 – 1 = 2/7 When x = 1: t = 5/7, y = 15/7 – 1 = 8/7 When y = -1: t = 0, x = -4 When y = 1: t = 2/3, x = 14/3 – 4 = 1/3

Recall that a 2-D parametric line segment from (x 0,y 0 ) to (x 1,y 1 ) is described by the equations x(t) = x 0 + t(x 1 – x 0 ) and y(t) = y 0 + t(y 1 – y 0 ), and recall the clipping window extends from (-1,-1) to (1,1). What are the (x,y) coordinates of the two points where the line segment from (-4,-1) to (3,2) intersects the clipping boundary? x(t) = -4 + t(3 - -4) = 7t – 4 y(t) = -1 + t(2 - -1) = 3t – 1 When x = -1: t = 3/7, y = 9/7 – 1 = 2/7 When x = 1: t = 5/7, y = 15/7 – 1 = 8/7 When y = -1: t = 0, x = -4 When y = 1: t = 2/3, x = 14/3 – 4 = 1/3 Answer: (1/3,1) & (-1,2/7)

Give transformation matrix for: Rotation by about y axis Squash 0.5 times along x-axis Translate one unit along z-axis

Give transformation matrix for: Rotation by about y axis Squash 0.5 times along x-axis Translate one unit along z-axis or

v – view vector: v = (e – x)/||e – x|| l – light vector: l = (lp – x)/||lp – x|| n – normal vector: n = (x 1 -x 0 )  (x 2 -x 0 )/||(x 1 -x 0 )  (x 2 -x 0 )|| v l e lp x n x0x0 x2x2 x1x1 LiLi LoLo

Monochromatic lighting, L o = k a L a + L i (k d n  l + k s (v  r) n )  L a : Ambient component of light source  k a : Ambience reflection constant  L i : Incident light  k s : Specular reflection constant  k d : Diffuse reflection constant

Model Coords World Coords Viewing Coords Clip Coords Screen Coords x y z x y lookat point eye point

1. Translate the eye point to the origin 2. Rotate the view vector into the negative z-axis x y z x y z

 Orthogonalize lookat vector system  Let r = v  up/||v  up||  Let u = r  v  Create rotation matrix from to R r = x, R u = y, R v = -z x y z up u v r

IN A WORLD… the eye is at position (5,0,0) looking at the origin, where up is the +y direction, find a viewing transformation that transforms this world into viewing coordinates such that the eye is at the origin looking down the negative z axis, and the +y direction is vertical.

Step 1: Find the lookat vector, the unit vector from the eye toward the point being looked at. L = (0,0,0) - (5,0,0) = (-5,0,0) Step 2: Translate eye to origin with a transformation matrix T. Normalize get (-1,0,0)

IN A WORLD… the eye is at position (5,0,0) looking at the origin, where up is the +y direction, find a viewing transformation that transforms this world into viewing coordinates such that the eye is at the origin looking down the negative z axis, and the +y direction is vertical. Step 3: Rotate lookat vector into –z axis. Translation moves lookat point (0,0,0) to (-5,0,0), so the lookat vector is in the direction of –x. Hence we need just a CCW -90 degree rotation about y axis. Step 4: Combine the transformation. V = RT

x y z x y z Model Coords World Coords Viewing Coords Clip Coords Screen Coords

screen -z y z view y view d y clip

Create a perspective projection matrix P for a perspective view where the projection plane is a distance of 10 units from the eye.