Post by Scott B on Jan 24, 2006 16:50:26 GMT -5
const screenwidth = 640
const screenheight = 480
const rad = 30
dim tj,ti
dim temp1#(32)(1)
dim temp2#(1)(24)
dim i,j
dim x,y
dim incx#
dim incy#
dim angleinc1#
dim angleinc2#
dim ang1#(32)(24)
dim ang2#(32)(24)
dim x#(32)(24)
dim y#(32)(24)
dim xpts#(32)(24)
dim ypts#(32)(24)
dim xtex#(32)(24)
dim ytex#(32)(24)
x = 10
y = 10
for j = 1 to 24
for i = 1 to 32
x#(i)(j) = x
y#(i)(j) = y
xtex#(i)(j) = incx#
ytex#(i)(j) = incy#
ang1#(i)(j) = angleinc1#
ang2#(i)(j) = angleinc2#
x = x + 20
incx# = incx# + .03125
angleinc2# = angleinc2# + .19625
next
incx# = 0
x = 10
y = y + 20
incy# = incy# + .041666
angleinc1# = angleinc1# + .261666
angleinc2# = 0
next
glMatrixMode (GL_PROJECTION)
glLoadIdentity ()
glOrtho (0, screenwidth, 0, screenheight, 0,1)
glMatrixMode (GL_MODELVIEW)
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
glEnable (GL_BLEND)
glEnable(GL_TEXTURE_2D)
dim textures(1)
textures(1) = LoadMipmapTexture ("textures\l005.jpg")
while true
for j = 1 to 24
for i = 1 to 32
xpts#(i)(j) = x#(i)(j) + rad * sin(ang1#(i)(j))
ypts#(i)(j) = y#(i)(j) + rad * sin(ang2#(i)(j))
next
next
glClear (GL_COLOR_BUFFER_BIT)
glBindTexture (GL_TEXTURE_2D, textures(1))
glBegin(GL_QUADS)
glColor4f(1,1,1,1)
for j = 1 to 24 - 1
for i = 1 to 32 - 1
glTexCoord2f(xtex#(i)(j+1),ytex#(i)(j+1))
glVertex2f(xpts#(i)(j+1),ypts#(i)(j+1))
glTexCoord2f(xtex#(i)(j),ytex#(i)(j))
glVertex2f(xpts#(i)(j),ypts#(i)(j))
glTexCoord2f(xtex#(i+1)(j),ytex#(i+1)(j))
glVertex2f(xpts#(i+1)(j),ypts#(i+1)(j))
glTexCoord2f(xtex#(i+1)(j+1),ytex#(i+1)(j+1))
glVertex2f(xpts#(i+1)(j+1),ypts#(i+1)(j+1))
next
next
glEnd()
SwapBuffers()
' ********** X values **********
for i = 1 to 32
temp1#(i)(1) = ang1#(i)(24)
next
tj = 24
for j = 2 to 24
for i = 1 to 32
ang1#(i)(tj) = ang1#(i)(tj-1)
next
tj = tj - 1
next
for i = 1 to 32
ang1#(i)(1) = temp1#(i)(1)
next
' ********** End X values **********
' ********** Y values **********
for j = 1 to 24
temp2#(1)(j) = ang2#(32)(j)
next
ti = 32
for j = 1 to 24
for i = 2 to 32
ang2#(ti)(j) = ang2#(ti-1)(j)
ti = ti - 1
next
ti = 32
next
for j = 1 to 24
ang2#(1)(j) = temp2#(1)(j)
next
' ********** End Y values **********
wend
const screenheight = 480
const rad = 30
dim tj,ti
dim temp1#(32)(1)
dim temp2#(1)(24)
dim i,j
dim x,y
dim incx#
dim incy#
dim angleinc1#
dim angleinc2#
dim ang1#(32)(24)
dim ang2#(32)(24)
dim x#(32)(24)
dim y#(32)(24)
dim xpts#(32)(24)
dim ypts#(32)(24)
dim xtex#(32)(24)
dim ytex#(32)(24)
x = 10
y = 10
for j = 1 to 24
for i = 1 to 32
x#(i)(j) = x
y#(i)(j) = y
xtex#(i)(j) = incx#
ytex#(i)(j) = incy#
ang1#(i)(j) = angleinc1#
ang2#(i)(j) = angleinc2#
x = x + 20
incx# = incx# + .03125
angleinc2# = angleinc2# + .19625
next
incx# = 0
x = 10
y = y + 20
incy# = incy# + .041666
angleinc1# = angleinc1# + .261666
angleinc2# = 0
next
glMatrixMode (GL_PROJECTION)
glLoadIdentity ()
glOrtho (0, screenwidth, 0, screenheight, 0,1)
glMatrixMode (GL_MODELVIEW)
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
glEnable (GL_BLEND)
glEnable(GL_TEXTURE_2D)
dim textures(1)
textures(1) = LoadMipmapTexture ("textures\l005.jpg")
while true
for j = 1 to 24
for i = 1 to 32
xpts#(i)(j) = x#(i)(j) + rad * sin(ang1#(i)(j))
ypts#(i)(j) = y#(i)(j) + rad * sin(ang2#(i)(j))
next
next
glClear (GL_COLOR_BUFFER_BIT)
glBindTexture (GL_TEXTURE_2D, textures(1))
glBegin(GL_QUADS)
glColor4f(1,1,1,1)
for j = 1 to 24 - 1
for i = 1 to 32 - 1
glTexCoord2f(xtex#(i)(j+1),ytex#(i)(j+1))
glVertex2f(xpts#(i)(j+1),ypts#(i)(j+1))
glTexCoord2f(xtex#(i)(j),ytex#(i)(j))
glVertex2f(xpts#(i)(j),ypts#(i)(j))
glTexCoord2f(xtex#(i+1)(j),ytex#(i+1)(j))
glVertex2f(xpts#(i+1)(j),ypts#(i+1)(j))
glTexCoord2f(xtex#(i+1)(j+1),ytex#(i+1)(j+1))
glVertex2f(xpts#(i+1)(j+1),ypts#(i+1)(j+1))
next
next
glEnd()
SwapBuffers()
' ********** X values **********
for i = 1 to 32
temp1#(i)(1) = ang1#(i)(24)
next
tj = 24
for j = 2 to 24
for i = 1 to 32
ang1#(i)(tj) = ang1#(i)(tj-1)
next
tj = tj - 1
next
for i = 1 to 32
ang1#(i)(1) = temp1#(i)(1)
next
' ********** End X values **********
' ********** Y values **********
for j = 1 to 24
temp2#(1)(j) = ang2#(32)(j)
next
ti = 32
for j = 1 to 24
for i = 2 to 32
ang2#(ti)(j) = ang2#(ti-1)(j)
ti = ti - 1
next
ti = 32
next
for j = 1 to 24
ang2#(1)(j) = temp2#(1)(j)
next
' ********** End Y values **********
wend