第三章 二维图形的变换与显示.pptVIP

  • 5
  • 0
  • 约2.35万字
  • 约 69页
  • 2018-05-18 发布于四川
  • 举报
1) global.h: #if !defined(AFX_GLOBAL_H) #define AFX_GLOBAL_H typedef enum{Left, Right, Bottom, Top} Edge; #define N_EDGE 4 typedef struct{float x,y;} Point2f; typedef struct{int x,y;} Point2i; int ClipPolygon(Point2i wMin,Point2i wMax,int n,Point2f *pIn,Point2f *pOut); #define MAXOUTPUT 200 //输出多边形的最多点数 #endif//AFX_GLOBAL_H 2) ClipPolygon.cpp: #include stdafx.h #include global.h //流水线裁减算法 int inside(Point2f p,Edge b,Point2i wMin,Point2i wMax) { switch(b) { case Left: if(p.xwMin.x) return(false); break; case Right: if(p.xwMax.x) return(false); break; case Bottom: if(

文档评论(0)

1亿VIP精品文档

相关文档