So, here’s a question. I normally use Cohen Sutherland’s line clipping algorithm. It’s fairly straightforward. Can anyone personally recommend any better alternatives?
So, here’s a question. I normally use Cohen Sutherland’s line clipping algorithm. It’s fairly straightforward. Can anyone personally recommend any better alternatives?
It sort of depends on the platform (like in th'olden days on Z80/6502 I used to divide and conquer until the endpoint touched the clip window). For parametrics I used Cohen Sutherland for the longest time on 68K and early x86 I switched to Liang-Barsky for a while as it's marginally more efficient.
Might have to dig out my notes. I have done this before on Z80. My first effort was a divide and conquer. It was so long ago!