Project1
标题:
求闪电图像算法
[打印本页]
作者:
TheRebirth
时间:
2013-7-21 22:44
标题:
求闪电图像算法
网上找又找不到好的资料,自己做又只能做出这种半调子的畸形出来…
2.PNG
(1.28 KB, 下载次数: 9)
下载附件
保存到相册
2013-7-21 22:43 上传
我倒是很想说这哪里看起来像闪电了
关键源码如下:
GLfloat random[50];
for (int i=0;i<51;i++)
{
random
=rand()%200/200.0f;
}
glBegin(GL_QUADS);
for (i=0;i<50;i++)
{
glColor3f(1.0f,1.0f,1.0f);glVertex3f(i*0.24f-6.0f,random
/2.0f,0.0f);
glColor3f(1.0f,1.0f,1.0f);glVertex3f((i+1)*0.24f-6.0f,random[i+1]/2.0f,0.0f);
glColor3f(1.0f,1.0f,1.0f);glVertex3f((i+1)*0.24f-6.0f,random[i+1]/2.0f-0.2f,0.0f);
glColor3f(1.0f,1.0f,1.0f);glVertex3f(i*0.24f-6.0f,random
/2.0f-0.2f,0.0f);
}
glEnd();
作者:
一瞬间的幻觉
时间:
2013-7-21 23:26
已经不错了,你试试看把RAND加大一倍。。。
作者:
orochi2k
时间:
2013-7-22 06:47
GLBEGIN GLEND在天朝坑了多少代人
少年们,我们继续绑着VBO玩SHADER吧
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1