Jump to content

Talk:Cohen–Sutherland algorithm

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by S charette (talk | contribs) at 08:54, 22 February 2017 (License?: new section). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

what is outcode is the point is on the line x=xmin or x=xmax or y=ymin or y=ymaz ? please help me

It has to be INSIDE when it's on the boundary, otherwise the loop will never terminate (unless both points are initially INSIDE.) 2620:79:0:165:1A03:73FF:FE20:3C3B (talk) 01:30, 13 November 2012 (UTC)[reply]

Implementation

if (!(outcode0 | outcode1)) { // Bitwise OR is 0. Trivially accept and get out of loop

Wouldn't logical OR be faster and more intuitive here? Also, shouldn't the whole algorithm be rewritten using Allman indentation style? And the last point, shouldn't we use use more structured approach? while (true) and breaks may be not friendly for beginners. My opinion. FaTony (talk)

License?

Where was the source code taken from? Is there a license to go along with it? Stéphane Charette (talk) 08:54, 22 February 2017 (UTC)[reply]