1 / 28

Tong-Yee Lee

Tong-Yee Lee. A view frustum, with near- and far- clip planes. Only the shaded volume is rendered. 2D Clipping but waste division for outside viewing window. This manner is OK. But, it needs “ Division ” before clipping. Sometimes, it is kind of waste. For example, red color shapes below.

pbarr
Download Presentation

Tong-Yee Lee

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. Tong-Yee Lee

  2. A view frustum, with near- and far- clip planes. Only the shaded volume is rendered.

  3. 2D Clipping but waste division for outside viewing window

  4. This manner is OK. But, it needs “Division” before clipping. Sometimes, it is kind of waste. For example, red color shapes below. Z=-f Z=0 Z = -n

  5. Another Trivial Rejection Clipping w = -z What does it imply? Remember if a point is behind eye, we can not see it!!. i.e., z > 0, means it is behind eye. So, we can check the fourth item(before division). If the fourth item is negative, this point is behind the eye point.

  6. Removing Back-Faces • Idea: Compare the normal of each face with the viewing direction Given n, the outward-pointing normal of F for each face F of object     if (n.v > 0)         throw away the faceDoes it work? It always culls half number of input polygons

  7. Inside Outside Outside Inside A Case 2 Case 1 P’: output B A B P: output P: output second A B B P’: output first No output Case 4 Case 3 A Outside Inside Inside Outside

  8. B A

  9. B P: output second P’: output first A

  10. B A P: output

  11. A P’: output B

  12. A No output B

  13. B No output A

  14. Polygon Clipping in Homogeneous Coordinates (Clipping Space Coordinates

  15. C’ color is also linearly interpolated such as C’(r) = A’ (r)+(B’ (r)-A’(r))*t C’(g) = A’(g)+(B’(g)-A’(g))*t ……………. Or even for original 3D position (x,y,z) or texture space (u,v) or normal vector (Nx,Ny,Nz) Aout != Bout

  16. Case 2 Case 4 Ex: left: C0=-C3 C0=A0+t(B0-A0) C3=A3+t(B3-A3) A0+t(B0-A0) = -A3-t(B3-A3) =>> (-A3-A0)=t(B0-A0+B3-A3) Case 4 Case 1 Ex: left side B0,B1,B2,B3 A0,A1,A2,A3 Return #num of vertex

  17. P: output second A B P’: output first Case 4 Outside Inside C C Ex: left boundary: C0=-C3 C0=A0+t(B0-A0) C3=A3+t(B3-A3) A0+t(B0-A0) = -A3-t(B3-A3) =>> (-A3-A0)=t(B0-A0+B3-A3) Left boundary C0=-C3 Right boundary C0=+C3 bottom boundary X : A0, B0 Y : A1, B1 Z : A2, B2 W: A3, B3 C1=-C3 ……….. ………..

  18. Outside Inside A Case 1 B P: output !Aout = !Bout Aout!=Bout Then, Bout is also input into the polygon!

  19. At most,it will have 6 extra vertex after clipping with six planes Circulate each Input polygon Vertex according To Sutherland- Hodgman polygon clipping

  20. Bounding Volume • Simple shape that completelyencloses an object • Generally a box or sphere • We’ll use spheres: • Easiest to work with • Though hard to gettight fits

  21. Hierarchical bounding volumes Recall class about projection example

More Related