Sutherland–Hodgman algorithm: Difference between revisions

Content deleted Content added
Jmsarazee (talk | contribs)
Line 67:
 
public:
std::vector<Point2d> GetClippedPoints()
{
std::vector<Point2d> polygonVertices = candidatePolygon.GetVertices();
std::vector<Point2d> clipping = clippingPolygon.GetVertices();
 
for (size_t i = 0; i < clipping.size(); i++)
{
Line2d clippingEdge(clipping[i], clipping[(i + 1) % clipping.size()]);
std::vector<Point2d> temp;
 
Line 114:
int main()
{
//////////////////////// Initialize /////////////////////////
Coordinates2d::ShowWindow("Sutherland-Hodgman Line Clipping");
///////////////////////////////////////////////////////////////
Line 145:
Coordinates2d::Draw(poly2, Yellow);
 
/////////////////////// Finalize /////////////////////////////
Coordinates2d::Wait();
return 0;