OpenGL 凸多边形截取线段,Cyrus-Beck算法 点此下载相关资源: http://download.csdn.net/user/rorger //roger, 2011 //OpenGL 凸多边形截取线段 #include "myglbase.h" #include "glut.h" #include "vector" #include "iostream" #include "glut.h" using namespace std; //线段类 class Line2Segment { public: Point2 first ; Point2 second ; Vector2 norm() { Vector2 c = second - first ; Vector2 normalVector = c.GetNormalVector(); return normalVector; } Line2Segment() { first.x=first.y=0; second.x=second.y=0; } Line2Segment(Point2 first,Point2 second) { this->first = first; this->second = second; } Line2Segment(Lin