Talk:Sutherland–Hodgman algorithm: Difference between revisions

Content deleted Content added
No edit summary
Implementing WP:PIQA (Task 26)
 
(6 intermediate revisions by 5 users not shown)
Line 1:
{{WikiProject Computingbanner shell|class=Stub|importance=|auto=yes}}
{{WikiProject Computer graphics|auto=yes
}}
{{WikiProject Computing|importance=|auto=yes}}
}}
==Images needed==
 
Line 5 ⟶ 9:
:There is a free image on commons [[commons:image:Sutherland-Hodgman clipping sample.svg]] [[Special:Contributions/83.5.93.48|83.5.93.48]] ([[User talk:83.5.93.48|talk]]) 12:07, 11 March 2008 (UTC)
 
==Inaccurate algorithm?==
The algorithm is wrong too, kinda a big deal.
 
I'm certain the pseudocode presented here is inaccurate - by testing points for inclusion in the clip plane rather than testing them sequentially against the infinitely-extended clip plane edges (as in the diagrams above), the point of the algorithm is missed and bugs are introduced. For example, the leftmost line on the capital W in the graphical example would be clipped entirely because neither of its endpoints lie within the clip plane; the desired behaviour is, of course, to clip it to two edges of the clip plane as shown.
 
Unless anyone steps in here to point out an error in my thinking, I'll rewrite the algorithm within the next day or two. Comments?
[[User:Cooperised|Cooperised]] ([[User talk:Cooperised|talk]]) 17:06, 23 June 2009 (UTC)
 
'''Algorithm rewritten.''' I've adopted a loosely object-oriented style for the pseudocode, if anyone hates it they can change it. :-) [[User:Cooperised|Cooperised]] ([[User talk:Cooperised|talk]]) 10:13, 24 June 2009 (UTC)