Sutherland-Hodgman polygon clipping: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: IupCloseOnEscape no longer needed) |
|||
Line 1,763: | Line 1,763: | ||
var outputList = subjectPolygon; |
var outputList = subjectPolygon; |
||
cp1 = clipPolygon[clipPolygon.length-1]; |
cp1 = clipPolygon[clipPolygon.length-1]; |
||
for (j in clipPolygon) { |
for (var j in clipPolygon) { |
||
var cp2 = clipPolygon[j]; |
var cp2 = clipPolygon[j]; |
||
var inputList = outputList; |
var inputList = outputList; |
||
outputList = []; |
outputList = []; |
||
s = inputList[inputList.length - 1]; //last on the input list |
s = inputList[inputList.length - 1]; //last on the input list |
||
for (i in inputList) { |
for (var i in inputList) { |
||
var e = inputList[i]; |
var e = inputList[i]; |
||
if (inside(e)) { |
if (inside(e)) { |