1 / 6

3D Clipping & Viewing process

3D Clipping & Viewing process. 3D Cohen-Sutherland Algorithm. Y axis. +1. y=z. Back. Clipping. Front. Plane. Clipping. z=-1. Plane. -Z. -1. 3-D Extension of 2-D Cohen-Sutherland Algorithm,. y=-z. Outcode of six bits. A bit is true (1) when the. appropriate condition is satisfied.

jatin
Download Presentation

3D Clipping & Viewing process

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 3D Clipping& Viewing process

  2. 3D Cohen-Sutherland Algorithm Y axis +1 y=z Back Clipping Front Plane Clipping z=-1 Plane -Z -1 3-D Extension of 2-D Cohen-Sutherland Algorithm, y=-z Outcode of six bits. A bit is true (1) when the appropriate condition is satisfied -1 Bit 1 - Point is above view volume y > -z Bit 2 - Point is below view volume y < z Bit 3 - Point is right of view volume x > -z Bit 4 - Point is left of view volume x < z Bit 5 - Point is behind view volume z < -1 Bit 6 - Point is in front of view volume z > zmin

  3. 3D Cohen-Sutherland Algorithm • A line is trivially accepted if both endpoints have a code of all zeros. • A line is trivially rejected if the bit-by-bit logical AND of the codes is not all zeros. • Otherwise Calculate intersections. On the y = z plane from parametric equation of the line: y + t( y - y ) = z + t( z - z ) 0 1 0 0 1 0 Solve for t and calculate x and y. Already know z = y

  4. If t not between [0, 1], then the intersection in not between P0 and P1 t = (z0-y0)/[(y1 – y0)-(z1-z0)] If t between [0, 1], then use t to find x and y x = x0 + [(x1 – x0)(z0-y0)]/[(y1-y0)-(z1-z0)] y = y0 + [(y1 – y0)(z0-y0)]/[(y1-y0)-(z1-z0)] 3D Cohen-Sutherland Algorithm

  5. Specify a 3D view volume Nper = [Sper ][SHper ][T(-PRP) ][R ][T(-VRP)] Clip against view volume Project onto a 2D viewing plane Mper : d = -PRPn Apply 2D viewing transformations to map window contents into 2D-image viewport V = [T-1][S][T] 3D viewing process

  6. 3D viewing Transformation 3D to 2D 3D to 2D P’(x’,y’,z’,w) = [Mper][Nper][P(x,y,z,1)] 2D to Image P’’(x,y,1) = [V][P(x’/w,y’/w,1)]

More Related