![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
openGL
小果橙橙
这个作者很懒,什么都没留下…
展开
-
Lesson 1: Bresenham’s Line Drawing Algorithm
1. void line(int x0, int y0, int x1, int y1, TGAImage &image, TGAColor color) { for (float t=0.; t1.; t+=.01) { int x = x0*(1.-t) + x1*t; int y = y0*(1.-t) + y1*t; ima转载 2016-03-16 16:55:12 · 687 阅读 · 0 评论 -
Lesson 2: Triangle rasterization and back face culling
1.实现画三角形 void triangle(Vec2i t0, Vec2i t1, Vec2i t2, TGAImage &image, TGAColor color) { line(t0, t1, image, color); line(t1, t2, image, color); line(t2, t0, image, color); } // ...转载 2016-03-17 18:16:12 · 294 阅读 · 0 评论 -
Lesson 3: Hidden faces removal (z buffer)
1. { // just dumping the 2d scene (yay we have enough dimensions!) TGAImage scene(width, height, TGAImage::RGB); // scene "2d mesh" line(Vec2i(20, 34), Vec2i(744, 400转载 2016-03-18 16:36:11 · 300 阅读 · 1 评论