Sutherland–Hodgman algorithm: Difference between revisions

Content deleted Content added
Line 19:
List inputList = outputList;
outputList.clear();
Point last_pointprev_point = inputList.last;
//
for (Point current_point in inputList) do
if (current_point inside clipEdge) then
if (last_pointprev_point not inside clipEdge) then
outputList.add(ComputeIntersection(last_pointprev_point,current_point,clipEdge));
end if
outputList.add(current_point);
else if (last_pointprev_point inside clipEdge) then
outputList.add(ComputeIntersection(last_pointprev_point,current_point,clipEdge));
end if
last_pointprev_point = current_point;
done
done