140 likes | 376 Views
Three-Dimensional Viewing Clipping. Computer Graphics C Version (456p - 462p). Objectives of this Chapter. General Ideas How clipping could be performed using the view volume Normalized view volume Homogeneous coordinates . General Ideas for 3D Clipping. A Point of Similarity
E N D
Three-Dimensional ViewingClipping Computer Graphics C Version (456p - 462p)
Objectives of this Chapter • General Ideas • How clipping could be performed using the view volume • Normalized view volume • Homogeneous coordinates
General Ideas for 3D Clipping • A Point of Similarity • Accomplished with extensions of 2D clipping method • A Point of Difference • Clipping against boundary planes of view volume instead of boundary edge
Line Clipping - 1 • View volume’s boundary plane Eq • Ax + By + Cz + d = 0 • If point is (x, y, z) • Inside boundary: Ax + By + Cz + d < 0 • Outside boundary: Ax + By + Cz + d > 0
Line Clipping - 2 • Cases of 2 end points’ position • All inside • Saved • All outside • Discard • Leaving intersection • One inside, one outside • Leaving intersection • Intersection coordinate (xi, yi, zi) Axi + Byi + Czi + d = 0
Viewing Transformation - 1 • Expanded PHIGS transformation pipeline
Viewing Transformation - 1 • View Volume Clipping • Rectangular parallelepiped view volume Clipping • Unit cube clipping
Viewing Transformation - 2 • View Volume Clipping • Needs to obtain all 6 planes equations • Rectangular parallelepiped view volume Clipping • Each surface is perpendicular to one coordinate axes • Converting to Rect parallelepiped view volume Orthographic view volume Oblique view volume Perspective view volume
Viewing Transformation - 3 • Unit cube clipping • Providing standard shape for representing any sized view volume • Providing simplified clipping procedure • Providing simplified depth cueing and visible-surface determination ->Normalized view volume
Normalized View Volume • Dimensions of the view volume and 3D viewport
Normalized View Volume Dx= Dz= Dy= Kx= Ky= Kz=
Viewport Clipping • Cohen Sutherland (6 Bit code) • Bit 1 =1 x<XVmin (left) • Bit 2 =1 x<XVmax (right) • Bit 3 =1 y<YVmin (below) • Bit 4 =1 y>YVmin (above) • Bit 5 =1 z<ZVmin (front) • Bit 6 =1 z>ZVmax (back) • Cyrus-Beck or Liang-Barsky • X = X1 + (X2 - X1)u • Y = Y2 + (Y2 - Y1)u • Z = Z3 + (Z2 – Z1)u
Clipping in Homogeneous Coordinates • Conversion • (x, y, z) -> (x, y, z, 1) X’= Y’= Z’= =