- 博客(6)
- 资源 (6)
- 收藏
- 关注
原创 Sutherland-Hodgman多边形裁剪
typedef enum{ Left, Right, Bottom, Top } Boundary;const GLint nClip = 4;class wcPt2D{public: GLfloat x,y; wcPt2D(GLfloat _x, GLfloat _y) { x = _x; y = _y; } wcPt2D()
2009-09-25 20:01:00 2356 4
原创 两个玻璃球和 100层高楼 问题
你有两个玻璃球和一个100层的大高楼,你想测出最低在那一层将玻璃球丢下,玻璃球便会破碎。用什么样的战术可以确保得到结果(i.e. 你的战术不能出现两个球都碎了,还找不到答案的情况),并且总共丢球的次数最小化?如果你有 N 个玻璃球,你的战术会是什么? 在http://www.xycq.net/forum/thread-123745-1-6.html 看到比较巧妙的分析,受益匪浅,所以决定记
2009-09-25 15:15:00 6863
原创 Liang - Barsk 线段裁剪算法
GLint clipTest(GLfloat p, GLfloat q, GLfloat * u1, GLfloat * u2){ GLfloat r; GLint returnValue = true; if( p < 0.0 ) { r = q / p; if( r > *u2) returnValue = false; else if( r
2009-09-25 15:13:00 1861
原创 Cohen-Sutherland线段裁剪算法
lass wcPt2D{public: GLfloat x,y; wcPt2D(GLfloat _x, GLfloat _y) { x = _x; y = _y; } wcPt2D() { x = 0; y = 0; }};extern int round(const float a);extern void li
2009-09-25 15:09:00 1620
原创 中心点画圆算法 实现
void circlePlotPoints(GLint xc, GLint yc, screenPt circPt){ setPixel( xc + circPt.getx(), yc + circPt.gety()); setPixel( xc - circPt.getx(), yc + circPt.gety()); setPixel( xc + circPt.getx(),
2009-09-23 22:57:00 2105 2
原创 bresenham 画直线算法
void lineBresenham(int nStartX, int nStartY, int nEndX, int nEndY){ int dx = abs(nEndX - nStartX); int dy = abs(nEndY - nStartY); if( dx == 0 ) { if( nStartY > nEndY ) { int tem
2009-09-23 22:52:00 1105
opengles 2.0 programming guide source code
2013-08-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人