图形学多边形区域填充.docVIP

  • 11
  • 0
  • 约4.96千字
  • 约 6页
  • 2016-10-04 发布于重庆
  • 举报
图形学多边形区域填充

实验二:多边形的区域填充 一、实验目的与要求 通过实验,进一步理解和掌握几种常用多边形填充算法的基本原理 掌握多边形区域填充算法的基本过程 掌握在C/C++环境下用多边形填充算法编程实现指定多边形的填充。 二、实验内容 #include windows.h #include glut.h #include stdio.h #include math.h typedef float Color[3]; rgbColorEqual(Color c1,Color c2) { if(abs(c1[1]-c2[1])0.001 abs(c1[2]-c2[2])0.001 abs(c1[0]-c2[0])0.001) return true; else return false; } void setPixel(GLint x, GLint y) { glBegin(GL_POINTS); glVertex2i(x, y); glEnd(); } void getPixel(GLint x, GLint y, Color c) { glReadPixels(x,y,1,1,GL_RGB,GL_FLOAT,c); } void BoundaryFill(int x, int y,Color fillColor,Colo

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档