![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
计算机图形学
文章平均质量分 63
S-A-M
喜欢乒乓球,生活与IT的人。
展开
-
DDA算法画直线(VC++)
#include "Math.h" CDC *pDC; void DrawDDALine(int x0,int y0,int x1,int y1,int color) { double dx,dy,length,x,y; length=fabs(x1-x0)>=fabs(y1-y0)?fabs(x1-x0):fabs(y1-y0); d原创 2011-12-03 10:22:01 · 6841 阅读 · 0 评论 -
Bresenham 算法 画直线(VC++)
void DrawLine(int x0,int y0,int x1,int y1,int color) { int x,y,yStep,t; double d,k; bool step; step=fabs(y1-y0)-fabs(x1-x0)?true:false; if(step) { t=x0;x0=y原创 2011-12-03 15:31:44 · 2481 阅读 · 0 评论 -
Bresenham 画圆算法(VC++)
void bresenhamcircle(int x0,int y0,int r,int color) { int x,y; int d; d=1-r;x=0;y=r; while(x<=y) { pDC->SetPixel(x+x0,y+y0,color); pDC->SetPixel(-x+x0,y+y0,color); pDC->SetPixel原创 2011-12-03 16:02:23 · 4500 阅读 · 1 评论