Not logged in, Join Here! or Log In Below:  
News Articles Search    

 Home / 3D Theory & Graphics / Clipping polygon problem - polygon inclosing view region Account Manager
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

March 31, 2005, 05:33 PM

I am confused in how to clip a polygon that is inclosing the clipping region totally.

Obviously all you need to do is to make the cliped polygon the same as the clipping region
- but how do you know if it is really incloseing the clipping region or just out side of the region all together.




March 31, 2005, 09:00 PM

Basic forms of these algorithms work by comparing the polygon vertices to the planes that make the clipping region. Each plane judges a vertex to be In or Out. All the judgements for a vertex are considered together, if any single plane judges the vertex to be Out then the final judgement it Out.

In your case all the vertices will be judged Out, however, each vertex will have a different reason for being Out. For example, imagine the clipping region to be a square. Label the planes (lines) that make the square A, B, C, D, clockwise with A at the top. If we place four vertices, 1, 2, 3, 4, just outside the corners of the square (clockwise, 1 in upper-left) we would get the following judgements:

Vertex, A's judgements, B's, C's, D's -> Final Judgements

1 Out, In, In, Out -> Out
2 Out, Out, In, In -> Out
3 In, Out, Out, In -> Out
4 In, In, Out, Out -> Out

Notice that each has a different configuration of judgements. By examining these configurations one may determine how the polygon lies relative to the clipping region.



March 31, 2005, 09:07 PM


Thanks a lot - thats the help I needed.


This thread contains 3 messages.
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.