Presentation is loading. Please wait.

Presentation is loading. Please wait.

Gopi -ICS280F02 - Slide 1 Graphics Pipeline: First Pass.

Similar presentations


Presentation on theme: "Gopi -ICS280F02 - Slide 1 Graphics Pipeline: First Pass."— Presentation transcript:

1 Gopi -ICS280F02 - Slide 1 Graphics Pipeline: First Pass

2 Gopi -ICS280F02 - Slide 2 Graphics Pipeline: First pass Object representation (triangles) and computation of vertex attributesObject representation (triangles) and computation of vertex attributes Model-view transformationModel-view transformation Projection transformationProjection transformation Clipping and vertex interpolation of attributesClipping and vertex interpolation of attributes Rasterization and pixel interpolation of attributesRasterization and pixel interpolation of attributes

3 Gopi -ICS280F02 - Slide 3 Object Representation Most common: TRIANGLESMost common: TRIANGLES Advantages:Advantages: –Consistently planar –Rotationally-invariant interpolation during rasterization –Easy definition of topology as well as geometry –Easy hardware implementation

4 Gopi -ICS280F02 - Slide 4 Object Representation Other representations:Other representations: –Points (no connectivity information) –Quadrilaterals (non-planarity, inconsistent interpolation of attributes) –Images (no geometry: not useful in simulations) – Splines (to be converted to polygons for rasterization)

5 Gopi -ICS280F02 - Slide 5 Attributes Color (Red, Green, Blue)Color (Red, Green, Blue) Normal vectorNormal vector Texture coordinateTexture coordinate Transparency valueTransparency value...

6 Gopi -ICS280F02 - Slide 6 Graphics Pipeline: First pass Object representation (triangles) and computation of vertex attributesObject representation (triangles) and computation of vertex attributes Model-view transformationModel-view transformation Projection transformationProjection transformation Clipping and vertex interpolation of attributesClipping and vertex interpolation of attributes Rasterization and pixel interpolation of attributesRasterization and pixel interpolation of attributes

7 Gopi -ICS280F02 - Slide 7 Model-view transformations Model transformationModel transformation View transformationView transformation

8 Gopi -ICS280F02 - Slide 8 Model transformations Transform the object to the required position, size and orientation.Transform the object to the required position, size and orientation. – Can use any transformation to achieve this. –In graphics library/hardware only linear transformations like rotate, translate, scale, shear are supported.

9 Gopi -ICS280F02 - Slide 9 View transformation Viewing parameters: (9 parameters)Viewing parameters: (9 parameters) –View POINT (x,y,z), –Viewing direction (VECTOR): (vx,vy,vz), –View-up VECTOR: (ux,uy,uz). –Default: (0,0,0), (0,0,-1), (0,1,0) Transforming the scene such that the view point is at the origin, viewing direction is aligned with the negative Z axis, and the view-up vector is aligned with the positive Y axis.Transforming the scene such that the view point is at the origin, viewing direction is aligned with the negative Z axis, and the view-up vector is aligned with the positive Y axis. –Uses rotation and translation to achieve this transformation.

10 Gopi -ICS280F02 - Slide 10 Graphics Pipeline: First pass Object representation (triangles) and computation of vertex attributesObject representation (triangles) and computation of vertex attributes Model-view transformationModel-view transformation Projection transformationProjection transformation Clipping and vertex interpolation of attributesClipping and vertex interpolation of attributes Rasterization and pixel interpolation of attributesRasterization and pixel interpolation of attributes

11 Gopi -ICS280F02 - Slide 11 Projection Transformation Define the “view frustum” (6 parameters)Define the “view frustum” (6 parameters) –Assume origin is the view point –Near and far planes (planes parallel to XY plane in the negative Z axis) –Left, right, top, bottom rectangle defined on the near plane. X Y -Z near far

12 Gopi -ICS280F02 - Slide 12 Projection Transformation Transforming the view frustum (along with the objects inside it) into a cuboid with unit square faces on the near and far planes and with the negative Z axis passing through the center of these two faces.Transforming the view frustum (along with the objects inside it) into a cuboid with unit square faces on the near and far planes and with the negative Z axis passing through the center of these two faces. Consists of a “shear” and a “perspective projection” operations.Consists of a “shear” and a “perspective projection” operations.

13 Gopi -ICS280F02 - Slide 13 Graphics Pipeline: First pass Object representation (triangles) and computation of vertex attributesObject representation (triangles) and computation of vertex attributes Model-view transformationModel-view transformation Projection transformationProjection transformation Clipping and vertex interpolation of attributesClipping and vertex interpolation of attributes Rasterization and pixel interpolation of attributesRasterization and pixel interpolation of attributes

14 Gopi -ICS280F02 - Slide 14 Clipping and Interpolation of Attributes Clipping: Removing the portions of the polygon that is outside the view frustum. If the polygon spans inside and outside the view frustum, introduce new vertices on the boundary to remove the outside portion of the polygon.Clipping: Removing the portions of the polygon that is outside the view frustum. If the polygon spans inside and outside the view frustum, introduce new vertices on the boundary to remove the outside portion of the polygon. Interpolation: For the new vertices introduced, compute all the attributes of the original vertices by interpolation.Interpolation: For the new vertices introduced, compute all the attributes of the original vertices by interpolation.

15 Gopi -ICS280F02 - Slide 15 Window coordinate transformation After clipping, scale the square faces of the unit cuboid (square faced on the near and far planes) such that it represents the (relative) pixel coordinates. (You don’t consider the Z value).After clipping, scale the square faces of the unit cuboid (square faced on the near and far planes) such that it represents the (relative) pixel coordinates. (You don’t consider the Z value). Then translate these coordinates to the position of the window on the monitor screen to represent the absolute pixel coordinates.Then translate these coordinates to the position of the window on the monitor screen to represent the absolute pixel coordinates. This is called window coordinate transformation.This is called window coordinate transformation.

16 Gopi -ICS280F02 - Slide 16 Graphics Pipeline: First pass Object representation (triangles) and computation of vertex attributesObject representation (triangles) and computation of vertex attributes Model-view transformationModel-view transformation Projection transformationProjection transformation Clipping and vertex interpolation of attributesClipping and vertex interpolation of attributes Rasterization and pixel interpolation of attributesRasterization and pixel interpolation of attributes

17 Gopi -ICS280F02 - Slide 17 Rasterization and Pixel Attribute Interpolation Rasterization is a process of generating pixels in the scan (horizontal) line order (top to bottom, left to right). (Also called “scan conversion”.)Rasterization is a process of generating pixels in the scan (horizontal) line order (top to bottom, left to right). (Also called “scan conversion”.) While generating pixels, the colors and other relevant attributes of the pixels are found by interpolating the attributes of the left and right extent of the scan line that lie on the polygon edge.While generating pixels, the colors and other relevant attributes of the pixels are found by interpolating the attributes of the left and right extent of the scan line that lie on the polygon edge. left right left Scan Line

18 Gopi -ICS280F02 - Slide 18 Graphics Pipeline: First pass End.

19 Gopi -ICS280F02 - Slide 19 (Layman) Object Definitions ManifoldsManifolds –2D: Every edge has exactly two incident triangles. –3D: Every triangle has exactly two incident tetrahedrons. Manifolds with boundariesManifolds with boundaries –2D: Every edge has either one or two incident triangles. –3D: Every triangle has either one or two incident tetrahedrons. Non-manifoldsNon-manifolds –That does not have the above restrictions.

20 Gopi -ICS280F02 - Slide 20 (Expert) Object Definitions ManifoldsManifolds –2D: Neighborhood of every point belonging to the object is homeomorphic to an open disc. –3D: Neighborhood of every point belonging to the object is homeomorphic to an open ball. Manifolds with boundariesManifolds with boundaries –2D: …(as above) or a half-disk. –3D:…(as above) or as half-ball Non-manifoldsNon-manifolds –That does not have the above restrictions.

21 Gopi -ICS280F02 - Slide 21 In this course.. 2D manifolds with boundaries.2D manifolds with boundaries. Remember: manifolds with boundaries is a superset of manifolds, and non-manifold is a superset of manifolds with boundaries. Non-manifold actually means that “need not” be a manifold; not “is not” a manifold.

22 Gopi -ICS280F02 - Slide 22 Genus (g) of a manifold Applicable only for manifoldsApplicable only for manifolds (Naïve) Number of “handles”.(Naïve) Number of “handles”. Sphere has g=0; cube has g=0; torus has g=1; coffee cup has g=1.Sphere has g=0; cube has g=0; torus has g=1; coffee cup has g=1.

23 Gopi -ICS280F02 - Slide 23 Euler Characteristic (e) of a manifold e = V-E+F (V: Vertices, E: Edges, F: Faces).e = V-E+F (V: Vertices, E: Edges, F: Faces). Applicable only for manifoldsApplicable only for manifolds In generalIn general –e=(0 dim)-(1 dim)+(2 dim)-(3 dim)+(4 dim)… Relationship between e and g: e=2-2gRelationship between e and g: e=2-2g –Sphere or Cube: e=2-2(0)=2 –Torus: e=2-2(1)=0 Verify: Cube has 8 vertices, 12 edges, 6 facesVerify: Cube has 8 vertices, 12 edges, 6 faces –e = V-E+F = 8-12+6 = 2


Download ppt "Gopi -ICS280F02 - Slide 1 Graphics Pipeline: First Pass."

Similar presentations


Ads by Google