March 1, 2009 Dr. Muhammed Al-Mulhem1 ICS 415 Computer Graphics Rendering Geometric Primitives Dr. Muhammed Al-Mulhem March 1, 2009 Dr. Muhammed Al-Mulhem.

Slides:



Advertisements
Similar presentations
Defining the Viewing Coordinate System
Advertisements

Vector Calculus Mengxia Zhu Fall Objective Review vector arithmetic Distinguish points and vectors Relate geometric concepts to their algebraic.
Three Dimensional Viewing
UBI 516 Advanced Computer Graphics
MAE152 Computer Graphicsfor Scientists and Engineers Revision of Matrices Relevance to Graphics.
2/7/2001Hofstra University – CSC290B1 Review: Math (Ch 4)
Part I: Basics of Computer Graphics Viewing Transformation and Coordinate Systems Chapter
CS5500 Computer Graphics March 22, Angel: Interactive Computer Graphics 3E © Addison-Wesley 2002 Coordinate-Free Geometry When we learned simple.
Welcome to CSc 830 Advanced Computer Graphics
CS485/685 Computer Vision Prof. George Bebis
Computer Graphics using OpenGL, 3 rd Edition F. S. Hill, Jr. and S. Kelley Chapter Vector Tools for Graphics.
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)
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.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
HCT.
Introduction to 3D Computer Graphics and Virtual Reality McConnell text.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
Basic graphics. ReviewReview Viewing Process, Window and viewport, World, normalized and device coordinates Input and output primitives and their attributes.
CS 450: Computer Graphics REVIEW: OVERVIEW OF POLYGONS
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
COMP 175: Computer Graphics March 24, 2015
Introduction to Computer Graphics CS 445 / 645 Lecture 6 Geometric primitives and the rendering pipepline Lecture 6 Geometric primitives and the rendering.
Geometric Transformation. So far…. We have been discussing the basic elements of geometric programming. We have discussed points, vectors and their operations.
Computer Graphics in Java1 Objects and Viewers Two basic entities (one object seen from two different positions) :
Transformations Dr. Amy Zhang.
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.
CS 445 / 645 Introduction to Computer Graphics Lecture 3 Mathematical Primitives Introduction to Transformations Lecture 3 Mathematical Primitives Introduction.
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.
CS 325 Introduction to Computer Graphics 02 / 17 / 2010 Instructor: Michael Eckmann.
CS 376 Introduction to Computer Graphics 02 / 16 / 2007 Instructor: Michael Eckmann.
Graphics Graphics Korea University cgvr.korea.ac.kr 3D Viewing 고려대학교 컴퓨터 그래픽스 연구실.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
Geometric Objects and Transformation
10/3/02 (c) 2002 University of Wisconsin, CS 559 Last Time 2D Coordinate systems and transformations.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
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.
CS 551 / 645: Introductory Computer Graphics Mathematical Foundations.
Geometric Transformations
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Jinxiang Chai CSCE 441 Computer Graphics 3-D Viewing 0.
12/24/2015 A.Aruna/Assistant professor/IT/SNSCE 1.
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
David Luebke2/16/2016 CS 551 / 645: Introductory Computer Graphics Mathematical Foundations The Rendering Pipeline.
Rendering Pipeline and Graphics Hardware Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006.
CS559: Computer Graphics Lecture 9: 3D Transformation and Projection Li Zhang Spring 2010 Most slides borrowed from Yungyu ChuangYungyu Chuang.
2/28/2016 CS 551 / 645: Introductory Computer Graphics Framebuffer Mathematical Foundations The Rendering Pipeline.
CS 376 Introduction to Computer Graphics 02 / 14 / 2007 Instructor: Michael Eckmann.
Chapter 1 Graphics Systems and Models Models and Architectures.
CS552: Computer Graphics Lecture 33: Illumination and Shading.
Graphics Graphics Korea University kucg.korea.ac.kr Geometric Primitives 고려대학교 컴퓨터 그래픽스 연구실.
David Luebke6/12/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Modeling Transformations Mario Costa Sousa University of Calgary CPSC 453, Fall 2001 Mario Costa Sousa University of Calgary CPSC 453, Fall 2001.
Outline 3D Viewing Required readings: HB 10-1 to 10-10
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.
Forward Projection Pipeline and Transformations CENG 477 Introduction to Computer Graphics.
3D Rendering 2016, Fall.
CA 302 Computer Graphics and Visual Programming
Rendering Pipeline Fall, 2015.
3D Viewing cgvr.korea.ac.kr.
CSCE 441 Computer Graphics 3-D Viewing
Modeling 101 For the moment assume that all geometry consists of points, lines and faces Line: A segment between two endpoints Face: A planar area bounded.
Three Dimensional Viewing
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
Presentation transcript:

March 1, 2009 Dr. Muhammed Al-Mulhem1 ICS 415 Computer Graphics Rendering Geometric Primitives Dr. Muhammed Al-Mulhem March 1, 2009 Dr. Muhammed Al-Mulhem March 1, 2009

Dr. Muhammed Al-Mulhem2 Rendering geometric primitives Describe objects with points, lines, and surfaces Compact mathematical notationCompact mathematical notation Operators to apply to those representationsOperators to apply to those representations Render the objects The rendering pipelineThe rendering pipelineReading: Appendix A1-A5Appendix A1-A5 Describe objects with points, lines, and surfaces Compact mathematical notationCompact mathematical notation Operators to apply to those representationsOperators to apply to those representations Render the objects The rendering pipelineThe rendering pipelineReading: Appendix A1-A5Appendix A1-A5

March 1, 2009 Dr. Muhammed Al-Mulhem3 Rendering Generate an image from geometric primitives Rendering Geometric Primitives Raster Image

March 1, 2009 Dr. Muhammed Al-Mulhem4 3D Rendering Example What issues must be addressed by a 3D rendering system?

March 1, 2009 Dr. Muhammed Al-Mulhem5 Overview 3D scene representation 3D viewer representation Visible surface determination Lighting simulation 3D scene representation 3D viewer representation Visible surface determination Lighting simulation

March 1, 2009 Dr. Muhammed Al-Mulhem6 Overview 3D scene representation 3D viewer representation Visible surface determination Lighting simulation 3D scene representation 3D viewer representation Visible surface determination Lighting simulation How is the 3D scene described in a computer? How is the 3D scene described in a computer?

March 1, 2009 Dr. Muhammed Al-Mulhem7 3D Scene Representation Scene is usually approximated by 3D primitives PointPoint Line segmentLine segment PolygonPolygon PolyhedronPolyhedron Curved surfaceCurved surface Solid objectSolid object etc.etc. Scene is usually approximated by 3D primitives PointPoint Line segmentLine segment PolygonPolygon PolyhedronPolyhedron Curved surfaceCurved surface Solid objectSolid object etc.etc.

March 1, 2009 Dr. Muhammed Al-Mulhem8 3D Point Specifies a location

March 1, 2009 Dr. Muhammed Al-Mulhem9 3D Point Specifies a location Represented by three coordinatesRepresented by three coordinates Specifies a location Represented by three coordinatesRepresented by three coordinates (x,y,z)

March 1, 2009 Dr. Muhammed Al-Mulhem10 3D Vector Specifies a direction and a magnitude

March 1, 2009 Dr. Muhammed Al-Mulhem11 3D Vector Specifies a direction and a magnitude Represented as the difference between two point positions by three coordinates (V x, V y, V z ).Represented as the difference between two point positions by three coordinates (V x, V y, V z ). Magnitude |V| = sqrt( V x 2 + V y 2 + V z 2 )Magnitude |V| = sqrt( V x 2 + V y 2 + V z 2 ) Has no locationHas no location Specifies a direction and a magnitude Represented as the difference between two point positions by three coordinates (V x, V y, V z ).Represented as the difference between two point positions by three coordinates (V x, V y, V z ). Magnitude |V| = sqrt( V x 2 + V y 2 + V z 2 )Magnitude |V| = sqrt( V x 2 + V y 2 + V z 2 ) Has no locationHas no location (Vx, Vy, Vz).

March 1, 2009 Dr. Muhammed Al-Mulhem12 Vector Addition/Subtraction Operation u + v, with: Identity 0 : v + 0 = vIdentity 0 : v + 0 = v Inverse - : v + (- v ) = 0Inverse - : v + (- v ) = 0 Addition uses the “parallelogram rule”: Operation u + v, with: Identity 0 : v + 0 = vIdentity 0 : v + 0 = v Inverse - : v + (- v ) = 0Inverse - : v + (- v ) = 0 Addition uses the “parallelogram rule”: u+v u v u-v u v -v

March 1, 2009 Dr. Muhammed Al-Mulhem13 Vector Space Vectors define a vector space They support vector additionThey support vector addition –Commutative and associative –Possess identity and inverse They support scalar multiplicationThey support scalar multiplication –Associative, distributive –Possess identity Vectors define a vector space They support vector additionThey support vector addition –Commutative and associative –Possess identity and inverse They support scalar multiplicationThey support scalar multiplication –Associative, distributive –Possess identity

March 1, 2009 Dr. Muhammed Al-Mulhem14 Affine Spaces Vector spaces lack position and distanceVector spaces lack position and distance –They have magnitude and direction but no location Combine the point and vector primitivesCombine the point and vector primitives –Permits describing vectors relative to a common location A point and three vectors define a 3-D coordinate systemA point and three vectors define a 3-D coordinate system Point-point subtraction yields a vectorPoint-point subtraction yields a vector Vector spaces lack position and distanceVector spaces lack position and distance –They have magnitude and direction but no location Combine the point and vector primitivesCombine the point and vector primitives –Permits describing vectors relative to a common location A point and three vectors define a 3-D coordinate systemA point and three vectors define a 3-D coordinate system Point-point subtraction yields a vectorPoint-point subtraction yields a vector

March 1, 2009 Dr. Muhammed Al-Mulhem15 Coordinate Systems Y X Z Right-handed coordinate system Z X Y Left-handed coordinate system Grasp z-axis with hand Thumb points in direction of z-axis Roll fingers from positive x-axis towards positive y-axis

March 1, 2009 Dr. Muhammed Al-Mulhem16 Points + Vectors Points support these operations Point-point subtraction: Q - P = vPoint-point subtraction: Q - P = v –Result is a vector pointing from P to Q Vector-point addition: P + v = QVector-point addition: P + v = Q –Result is a new point Note that the addition of two points is not definedNote that the addition of two points is not defined Points support these operations Point-point subtraction: Q - P = vPoint-point subtraction: Q - P = v –Result is a vector pointing from P to Q Vector-point addition: P + v = QVector-point addition: P + v = Q –Result is a new point Note that the addition of two points is not definedNote that the addition of two points is not defined P Q v

March 1, 2009 Dr. Muhammed Al-Mulhem17 3D Line Segment Linear path between two points

March 1, 2009 Dr. Muhammed Al-Mulhem18 3D Line Segment Use a linear combination of two points Parametric representation:Parametric representation: –P = P 1 + t (P 2 - P 1 ), (0  t  1) Use a linear combination of two points Parametric representation:Parametric representation: –P = P 1 + t (P 2 - P 1 ), (0  t  1) P1P1 P2P2

March 1, 2009 Dr. Muhammed Al-Mulhem19 3D Ray Line segment with one endpoint at infinity Parametric representation:Parametric representation: –P = P 1 + t V, (0 <= t <  ) Line segment with one endpoint at infinity Parametric representation:Parametric representation: –P = P 1 + t V, (0 <= t <  ) P1P1 V

March 1, 2009 Dr. Muhammed Al-Mulhem20 3D Line Line segment with both endpoints at infinity Parametric representation:Parametric representation: –P = P 1 + t V, (-  < t <  ) Line segment with both endpoints at infinity Parametric representation:Parametric representation: –P = P 1 + t V, (-  < t <  ) P1P1 V

March 1, 2009 Dr. Muhammed Al-Mulhem21 3D Line – Slope Intercept Slope =m = rise / run Slope = (y - y1) / (x - x1) = (y2 - y1) / (x2 - x1) Solve for y: y = [(y2 - y1)/(x2 - x1)]x + [-(y2-y1)/(x2 - x1)]x1 + y1 or: y = mx + b Slope =m = rise / run Slope = (y - y1) / (x - x1) = (y2 - y1) / (x2 - x1) Solve for y: y = [(y2 - y1)/(x2 - x1)]x + [-(y2-y1)/(x2 - x1)]x1 + y1 or: y = mx + b x y P2 = (x2, y2) P1 = (x1, y1) P = (x, y)

March 1, 2009 Dr. Muhammed Al-Mulhem22 Euclidean Spaces Q: What is the distance function between points and vectors in affine space? A: Dot product Euclidean affine space = affine space plus dot productEuclidean affine space = affine space plus dot product Permits the computation of distance and anglesPermits the computation of distance and angles Q: What is the distance function between points and vectors in affine space? A: Dot product Euclidean affine space = affine space plus dot productEuclidean affine space = affine space plus dot product Permits the computation of distance and anglesPermits the computation of distance and angles

March 1, 2009 Dr. Muhammed Al-Mulhem23 Dot Product The dot product or, more generally, inner product of two vectors is a scalar:The dot product or, more generally, inner product of two vectors is a scalar: v 1 v 2 = x 1 x 2 + y 1 y 2 + z 1 z 2 (in 3D) The dot product or, more generally, inner product of two vectors is a scalar:The dot product or, more generally, inner product of two vectors is a scalar: v 1 v 2 = x 1 x 2 + y 1 y 2 + z 1 z 2 (in 3D) u θ v

March 1, 2009 Dr. Muhammed Al-Mulhem24 Dot Product Useful for many purposes Computing the length (Euclidean Norm) of a vector:Computing the length (Euclidean Norm) of a vector: –length( v ) = ||v|| = sqrt( v v) Normalizing a vector, making it unit-length: v = v / ||v||Normalizing a vector, making it unit-length: v = v / ||v|| Computing the angle between two vectors:Computing the angle between two vectors: –u v = |u| |v| cos(θ) Checking two vectors for orthogonalityChecking two vectors for orthogonality –u v = 0.0 Useful for many purposes Computing the length (Euclidean Norm) of a vector:Computing the length (Euclidean Norm) of a vector: –length( v ) = ||v|| = sqrt( v v) Normalizing a vector, making it unit-length: v = v / ||v||Normalizing a vector, making it unit-length: v = v / ||v|| Computing the angle between two vectors:Computing the angle between two vectors: –u v = |u| |v| cos(θ) Checking two vectors for orthogonalityChecking two vectors for orthogonality –u v = 0.0 u θ v

March 1, 2009 Dr. Muhammed Al-Mulhem25 Projecting one vector onto another If v is a unit vector and we have another vector, wIf v is a unit vector and we have another vector, w We can project w perpendicularly onto vWe can project w perpendicularly onto v And the result, u, has length w vAnd the result, u, has length w v Projecting one vector onto another If v is a unit vector and we have another vector, wIf v is a unit vector and we have another vector, w We can project w perpendicularly onto vWe can project w perpendicularly onto v And the result, u, has length w vAnd the result, u, has length w v Dot Product u w v

March 1, 2009 Dr. Muhammed Al-Mulhem26 Dot Product Is commutative u v = v uu v = v u Is distributive with respect to addition u (v + w) = u v + u wu (v + w) = u v + u w Is commutative u v = v uu v = v u Is distributive with respect to addition u (v + w) = u v + u wu (v + w) = u v + u w

March 1, 2009 Dr. Muhammed Al-Mulhem27 Cross Product The cross product or vector product of two vectors is a vector: The cross product of two vectors is orthogonal to both Right-hand rule dictates direction of cross product The cross product or vector product of two vectors is a vector: The cross product of two vectors is orthogonal to both Right-hand rule dictates direction of cross product

March 1, 2009 Dr. Muhammed Al-Mulhem28 Cross Product Right Hand Rule See: Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A Twist your hand about the A-axis such that B extends perpendicularly from your palm As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

March 1, 2009 Dr. Muhammed Al-Mulhem29 Cross Product Right Hand Rule See: Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A Twist your hand about the A-axis such that B extends perpendicularly from your palm As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

March 1, 2009 Dr. Muhammed Al-Mulhem30 Cross Product Right Hand Rule See: Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A Twist your hand about the A-axis such that B extends perpendicularly from your palm As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

March 1, 2009 Dr. Muhammed Al-Mulhem31 Cross Product Right Hand Rule See: Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A Twist your hand about the A-axis such that B extends perpendicularly from your palm As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

March 1, 2009 Dr. Muhammed Al-Mulhem32 Cross Product Right Hand Rule See: Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A Twist your hand about the A-axis such that B extends perpendicularly from your palm As you curl your fingers to make a fist, your thumb will point in the direction of the cross product

March 1, 2009 Dr. Muhammed Al-Mulhem33 Other helpful formulas Length = sqrt (x2 - x1) 2 + (y2 - y1) 2 Midpoint, p2, between p1 and p3 p2 = ((x1 + x3) / 2, (y1 + y3) / 2))p2 = ((x1 + x3) / 2, (y1 + y3) / 2)) Two lines are perpendicular if: M1 = -1/M2M1 = -1/M2 cosine of the angle between them is 0cosine of the angle between them is 0 Dot product = 0Dot product = 0 Length = sqrt (x2 - x1) 2 + (y2 - y1) 2 Midpoint, p2, between p1 and p3 p2 = ((x1 + x3) / 2, (y1 + y3) / 2))p2 = ((x1 + x3) / 2, (y1 + y3) / 2)) Two lines are perpendicular if: M1 = -1/M2M1 = -1/M2 cosine of the angle between them is 0cosine of the angle between them is 0 Dot product = 0Dot product = 0

March 1, 2009 Dr. Muhammed Al-Mulhem34 3D Plane A linear combination of three points P1P1 P3P3 P2P2

March 1, 2009 Dr. Muhammed Al-Mulhem35 Origin 3D Plane A linear combination of three points Implicit representation:Implicit representation: –ax + by + cz + d = 0, or –P·N + d = 0 N is the plane “normal”N is the plane “normal” –Unit-length vector –Perpendicular to plane A linear combination of three points Implicit representation:Implicit representation: –ax + by + cz + d = 0, or –P·N + d = 0 N is the plane “normal”N is the plane “normal” –Unit-length vector –Perpendicular to plane P1P1 N = (a,b,c) d P3P3 P2P2

March 1, 2009 Dr. Muhammed Al-Mulhem36 3D Sphere All points at distance “r” from point “(c x, c y, c z )” Implicit representation:Implicit representation: –(x - c x ) 2 + (y - c y ) 2 + (z - c z ) 2 = r 2 Parametric representation:Parametric representation: –x = r cos(  ) cos(  ) + c x –y = r cos(  ) sin(  ) + c y –z = r sin(  ) + c z All points at distance “r” from point “(c x, c y, c z )” Implicit representation:Implicit representation: –(x - c x ) 2 + (y - c y ) 2 + (z - c z ) 2 = r 2 Parametric representation:Parametric representation: –x = r cos(  ) cos(  ) + c x –y = r cos(  ) sin(  ) + c y –z = r sin(  ) + c z r

March 1, 2009 Dr. Muhammed Al-Mulhem37 3D Geometric Primitives More detail on 3D modeling later in course PointPoint Line segmentLine segment PolygonPolygon PolyhedronPolyhedron Curved surfaceCurved surface Solid objectSolid object etc.etc. More detail on 3D modeling later in course PointPoint Line segmentLine segment PolygonPolygon PolyhedronPolyhedron Curved surfaceCurved surface Solid objectSolid object etc.etc. H&B Figure 10.46

March 1, 2009 Dr. Muhammed Al-Mulhem38 Take a breath We’re done with the primitives Now we’re moving on to study how graphics uses these primitives to make pretty pictures We’re done with the primitives Now we’re moving on to study how graphics uses these primitives to make pretty pictures

March 1, 2009 Dr. Muhammed Al-Mulhem39 Rendering 3D Scenes Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

March 1, 2009 Dr. Muhammed Al-Mulhem40 Camera Models The most common model is pin-hole camera All captured light rays arrive along paths toward focal point without lens distortion (everything is in focus)All captured light rays arrive along paths toward focal point without lens distortion (everything is in focus) Sensor response proportional to radianceSensor response proportional to radiance Other models consider...Depth of field, Motion blur, Lens distortion The most common model is pin-hole camera All captured light rays arrive along paths toward focal point without lens distortion (everything is in focus)All captured light rays arrive along paths toward focal point without lens distortion (everything is in focus) Sensor response proportional to radianceSensor response proportional to radiance Other models consider...Depth of field, Motion blur, Lens distortion View plane Eye position (focal point)

March 1, 2009 Dr. Muhammed Al-Mulhem41 Camera Parameters What are the parameters of a camera?

March 1, 2009 Dr. Muhammed Al-Mulhem42 Camera Parameters Position Eye position (px, py, pz)Eye position (px, py, pz)Orientation View direction (dx, dy, dz)View direction (dx, dy, dz) Up direction (ux, uy, uz)Up direction (ux, uy, uz)Aperture Field of view (xfov, yfov)Field of view (xfov, yfov) Film plane “Look at” point“Look at” point View plane normalView plane normalPosition Eye position (px, py, pz)Eye position (px, py, pz)Orientation View direction (dx, dy, dz)View direction (dx, dy, dz) Up direction (ux, uy, uz)Up direction (ux, uy, uz)Aperture Field of view (xfov, yfov)Field of view (xfov, yfov) Film plane “Look at” point“Look at” point View plane normalView plane normal right back Up direction Eye Position View  direction View Plane “Look at” Point

March 1, 2009 Dr. Muhammed Al-Mulhem43 Moving the camera View Frustum Right Back Towards Up

March 1, 2009 Dr. Muhammed Al-Mulhem44 The Rendering Pipeline Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

March 1, 2009 Dr. Muhammed Al-Mulhem45 Rendering: Transformations We’ve learned about transformations But they are used in three ways: Modeling transformsModeling transforms Viewing transforms (Move the camera)Viewing transforms (Move the camera) Projection transforms (Change the type of camera)Projection transforms (Change the type of camera) We’ve learned about transformations But they are used in three ways: Modeling transformsModeling transforms Viewing transforms (Move the camera)Viewing transforms (Move the camera) Projection transforms (Change the type of camera)Projection transforms (Change the type of camera)

March 1, 2009 Dr. Muhammed Al-Mulhem46 The Rendering Pipeline: 3-D Result: All vertices of scene in shared 3-D “world” coordinate system All vertices of scene in shared 3-D “world” coordinate system Vertices shaded according to lighting model Vertices shaded according to lighting model Scene vertices in 3-D “view” or “camera” coordinate system Scene vertices in 3-D “view” or “camera” coordinate system Exactly those vertices & portions of polygons in view frustum Exactly those vertices & portions of polygons in view frustum 2-D screen coordinates of clipped vertices 2-D screen coordinates of clipped vertices Scene graph Object geometry Lighting Calculations Clipping Modeling Transforms Viewing Transform Projection Transform

March 1, 2009 Dr. Muhammed Al-Mulhem47 The Rendering Pipeline: 3-D Modeling Transforms Scene graph Object geometry Lighting Calculations Viewing Transform Clipping Projection Transform Result: All vertices of scene in shared 3-D “world” coordinate system All vertices of scene in shared 3-D “world” coordinate system

March 1, 2009 Dr. Muhammed Al-Mulhem48 Rendering: Transformations Modeling transforms Size, place, scale, and rotate objects and parts of the model w.r.t. each otherSize, place, scale, and rotate objects and parts of the model w.r.t. each other Object coordinates -> world coordinatesObject coordinates -> world coordinates Modeling transforms Size, place, scale, and rotate objects and parts of the model w.r.t. each otherSize, place, scale, and rotate objects and parts of the model w.r.t. each other Object coordinates -> world coordinatesObject coordinates -> world coordinates Z X Y X Z Y

March 1, 2009 Dr. Muhammed Al-Mulhem49 The Rendering Pipeline: 3-D Modeling Transforms Scene graph Object geometry Lighting Calculations Viewing Transform Clipping Projection Transform Result: All geometric primitives are illuminatedAll geometric primitives are illuminated

March 1, 2009 Dr. Muhammed Al-Mulhem50 Lighting Simulation Lighting parameters Light source emissionLight source emission Surface reflectanceSurface reflectance Atmospheric attenuationAtmospheric attenuation Camera responseCamera response Lighting parameters Light source emissionLight source emission Surface reflectanceSurface reflectance Atmospheric attenuationAtmospheric attenuation Camera responseCamera response N N Camera Surface Light Source

March 1, 2009 Dr. Muhammed Al-Mulhem51 Lighting Simulation Direct illumination Ray castingRay casting Polygon shadingPolygon shading Global illumination Ray tracingRay tracing Monte Carlo methodsMonte Carlo methods Radiosity methodsRadiosity methods Direct illumination Ray castingRay casting Polygon shadingPolygon shading Global illumination Ray tracingRay tracing Monte Carlo methodsMonte Carlo methods Radiosity methodsRadiosity methods N N Camera Surface Light Source N

March 1, 2009 Dr. Muhammed Al-Mulhem52 Modeling Transforms Scene graph Object geometry Lighting Calculations Viewing Transform Clipping Projection Transform Result: Scene vertices in 3-D “view” or “camera” coordinate system Scene vertices in 3-D “view” or “camera” coordinate system The Rendering Pipeline: 3-D

March 1, 2009 Dr. Muhammed Al-Mulhem53 Rendering: Transformations Viewing transform Rotate & translate the world to lie directly in front of the cameraRotate & translate the world to lie directly in front of the camera –Typically place camera at origin –Typically looking down -Z axis World coordinates  View coordinatesWorld coordinates  View coordinates Viewing transform Rotate & translate the world to lie directly in front of the cameraRotate & translate the world to lie directly in front of the camera –Typically place camera at origin –Typically looking down -Z axis World coordinates  View coordinatesWorld coordinates  View coordinates Y X Z Right-handed coordinate system

March 1, 2009 Dr. Muhammed Al-Mulhem54 Modeling Transforms Scene graph Object geometry Lighting Calculations Viewing Transform Clipping Projection Transform Result: Remove geometry that is out of view Remove geometry that is out of view The Rendering Pipeline: 3-D

March 1, 2009 Dr. Muhammed Al-Mulhem55 Modeling Transforms Scene graph Object geometry Lighting Calculations Viewing Transform Clipping Projection Transform Result: 2-D screen coordinates of clipped vertices 2-D screen coordinates of clipped vertices The Rendering Pipeline: 3-D

March 1, 2009 Dr. Muhammed Al-Mulhem56 Rendering: Transformations Projection transform Apply perspective foreshorteningApply perspective foreshortening –Distant = small: the pinhole camera model View coordinates  Screen coordinatesView coordinates  Screen coordinates Projection transform Apply perspective foreshorteningApply perspective foreshortening –Distant = small: the pinhole camera model View coordinates  Screen coordinatesView coordinates  Screen coordinates

March 1, 2009 Dr. Muhammed Al-Mulhem57 Perspective Camera Orthographic Camera Perspective Camera Orthographic Camera Rendering: Transformations

March 1, 2009 Dr. Muhammed Al-Mulhem58 Rendering 3D Scenes Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

March 1, 2009 Dr. Muhammed Al-Mulhem59 Rasterize Convert screen coordinates to pixel colors

March 1, 2009 Dr. Muhammed Al-Mulhem60 Summary Geometric primitives Points, vectorsPoints, vectors Operators on these primitives Dot product, cross product, normDot product, cross product, norm The rendering pipeline Move models, illuminate, move camera, clip, project to display, rasterizeMove models, illuminate, move camera, clip, project to display, rasterize Geometric primitives Points, vectorsPoints, vectors Operators on these primitives Dot product, cross product, normDot product, cross product, norm The rendering pipeline Move models, illuminate, move camera, clip, project to display, rasterizeMove models, illuminate, move camera, clip, project to display, rasterize