|
Post by sai123456789 on Dec 9, 2009 12:28:19 GMT -5
sweet flames
|
|
|
Post by DJLinux on Dec 23, 2009 14:06:08 GMT -5
not bad (realy) Joshy const width = 128 const height = 64
const wm1 = width -1 ' vars with the same value const wm2 = width -2 ' while running schold be const wm3 = width -3 ' const const hm1 = height-1 const hm2 = height-2 const hm3 = height-3
dim a1(hm1)(wm1) dim a2(hm1)(wm1)
dim xm,x,xp, ym,y,yp, c1, c2, nohs, i, j
glMatrixMode (GL_PROJECTION) glLoadIdentity () gluOrtho2D (0, 2, 0, 1)
dim tex
glEnable (GL_TEXTURE_2D) tex = glGenTexture() glBindTexture (GL_TEXTURE_2D, tex) glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT) glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT)
' set it only ones glDisable (GL_DEPTH_TEST) glClearColor(0,0,0,0) glColor3f (100, 0, 0)
FOR x = 0 TO wm1 C1 = (RND() % 25) + 1 C2 = (RND() % 25) + 1 a1(hm2)(x) = c1 a1(hm1)(x) = c2 next
while true
nohs = INT(RND() % 1) + 8 FOR i = 1 TO nohs x = INT(RND() % (wm3)) + 1 xm=x-1 ' two calculations are better than 6 xp=x+1 a1(hm3)(xm) = 600 a1(hm3)(x ) = 600 a1(hm3)(xp) = 600 a1(hm2)(xm) = 600 a1(hm2)(x ) = 600 a1(hm2)(xp) = 600 a1(hm1)(xm) = 600 a1(hm1)(x ) = 600 a1(hm1)(xp) = 600 NEXT
for x = 1 to wm2 xm=x-1 ' remove the math from y loop xp=x+1 for y = 1 to hm2 ym=y-1 a2 (ym)(x) = (a1(y)(xm) + a1(y)(xp) + a1(ym)(x) + a1(y+1)(x)) / 4 - 3 next NEXT
FOR j = 0 TO hm1 FOR i = 0 TO wm1 if a2(j)(i) < 1 then a2(j)(i) = 1 endif a1(j)(i) = a2(j)(i) NEXT NEXT
glTexImage2D (GL_TEXTURE_2D, 0, 1, width, height, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, a1) glClear(GL_COLOR_BUFFER_BIT) glBegin(GL_triangle_fan) glTexCoord2f (0, 1): glVertex2f (0, -1) glTexCoord2f (1, 1): glVertex2f (2, -1) glTexCoord2f (1, 0): glVertex2f (2, 1) glTexCoord2f (0, 0): glVertex2f (0, 1) glEnd()
SwapBuffers() wend
|
|
lal7777
Posts
if all.knowledge = orange then: seed = mankind.knowledge: grow(seed,time): endif
Posts: 88
|
Post by lal7777 on Jan 28, 2011 0:59:46 GMT -5
nice, but why does there appear to be black boxes in the background of the flame sometimes?
|
|
|
Post by DJLinux on Jan 28, 2011 9:00:12 GMT -5
nice, but why does there appear to be black boxes in the background of the flame sometimes? i don't see any black boxes here. can you make a picture from your window/screen ? Joshy
|
|
lal7777
Posts
if all.knowledge = orange then: seed = mankind.knowledge: grow(seed,time): endif
Posts: 88
|
Post by lal7777 on Jan 30, 2011 15:51:21 GMT -5
i'm trying to attach an image... (doesn't show in preview, so i hope it works) Attachments:
|
|
lal7777
Posts
if all.knowledge = orange then: seed = mankind.knowledge: grow(seed,time): endif
Posts: 88
|
Post by lal7777 on Jan 30, 2011 15:53:02 GMT -5
well technically they're not boxes (more of a blurred box)... not shure how to describe those...
|
|