最近通过看《Computer Graphics Using OpenGL Second Edition》来学习计算机图形学。
当然是边看边学,用OpenGL在VC++下编了个谢尔平斯基镂垫(Sierpinski gasket), 效果如下:

这是我在visual studio 2005 下编译通过的源代码:
//
Draw sierpinski gasket
//
P49 in <Computer Graphics Using OpenGL>
#include
"
GLintPoint.h
"
#include
<
iostream
>

using
std::cout;
using
std::cin;
using
std::endl;

//
Create a number between 0 and m(a number which will be given)
//
the input m must be less than 32767 according to P49 in <Computer Graphics Using OpenGL>
int
random(
int
m)
...
{
int rand();
return rand()%m;
}

博主通过阅读《Computer Graphics Using OpenGL Second Edition》学习计算机图形学,并在VC++环境下利用OpenGL实现了谢尔平斯基镂垫的绘制,展示了在Visual Studio 2005下编译成功的源代码。
最低0.47元/天 解锁文章
677

被折叠的 条评论
为什么被折叠?



