# Cohen sutherland algorithm how to extend to 3d also

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Select a clip edge based on the outcode, split and feed the new segment on the side of the rectangle back into algorithm • Need to perform 4 intersection checks for each line. Cohen-Sutherland algorithm • How to extend to 3D? – Also clipping the lines using front / back planes • How many bits needed for the outcode? Cohen-Sutherland algorithm • How to extend to 3D? – Also clipping the lines using front / back planes • How many bits needed for the outcode? Polygon Clipping: Sutherland-Hodgman’s algorithm • A systematic approach to clip polygons • Input : A 2D polygon • Output : a list of vertices of the clipped polygon Polygons are clipped at each edge of the window while traversing the polygon Sutherland-Hodgman’s algorithm • The edges of the polygon are traversed • The edges can be divided into four types Inside Outside Output Vertex Inside Outside Output Intersection Case 1 Case 2. Inside Outside Case 3 No output. Inside Outside First Output Second Output Case 4 Sutherland-Hodgman’s algorithm For each edge of the clipping rectangle For each edge of the polygon (connecting pi, pi+1) • If case 1 add p+1 to the output • If case 2 add interaction to output • If case 4 add intersection and p+1 to output Inside Outside Output Vertex Case 1 Inside Outside Output Intersection Case 2. Inside Outside Case 3 No output. Inside Outside Second Output First Output Case 4 Example Sutherland-Hodgman algorithm • How to extend to 3D? Summary Projection Perspective, parallel (orthographic) projection Canonical view volume Clipping Cohen-Sutherland’s algorithm Sutherland-Hodgmans’s algorithm Another Good Modern Textbook http://www.realtimerendering.com/ Akenine-Moller Readings • Foley et al. Chapter 6 – all of it, • Particularly section 6.5 • Introductory text, Chapter 6 – all of it, • Particularly section 6.6 • Akenine-Moller, Real-time Rendering Chapter 3.5 • Clipping lines, polygons • Foley et al. Chapter 3.12, 3.14 • http://www.cc.gatech.edu/grads/h/Hao-wei. Hsieh/Haowei.Hsieh/mm.html...
View Full Document

## This document was uploaded on 03/26/2014.

Ask a homework question - tutors are online