Post by Alan on Jul 23, 2005 6:51:52 GMT -5
dim rot_x#
dim texture, n
dim v_x, v_y, v_z
dim v_xd#, v_yd#, v_zd#
dim v_fxd#, v_fyd#, v_fzd#
glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_zero)
glEnable(GL_BLEND)
here:
glLoadIdentity()
rot_x# = rot_x# + .5
glrotatef(((mouse_x() - .5) * 100), 0, 1, 0)
glTranslatef(0, 0, -40 + ((mouse_y() - .5) * 80))
glRotatef(rot_x#, 0, 1, 0)
n = n + 1
if n = 2000 then
n = 0
v_fxd# = v_fxd# + (((rnd()%10) - 5) * .1)
v_fyd# = v_fyd# + (((rnd()%10) - 5) * .1)
v_fzd# = v_fzd# + (((rnd()%10) - 5) * .1)
endif
v_xd# = v_xd# + v_fxd#
v_yd# = v_yd# + v_fyd#
v_zd# = v_zd# + v_fzd#
v_fxd# = v_fxd# * .99
v_fyd# = v_fyd# * .99
v_fzd# = v_fzd# * .99
if v_xd# > 0 then v_fxd# = v_fxd# - .001 endif
if v_xd# < 0 then v_fxd# = v_fxd# + .001 endif
if v_yd# > 0 then v_fyd# = v_fyd# - .001 endif
if v_yd# < 0 then v_fyd# = v_fyd# + .001 endif
if v_zd# > 0 then v_fzd# = v_fzd# - .001 endif
if v_zd# < 0 then v_fzd# = v_fzd# + .001 endif
v_xd# = v_xd# * .999
v_yd# = v_yd# * .999
v_zd# = v_zd# * .999
for v_x = -90 to 67.5 step 22.5
for v_y = -90 to 67.5 step 22.5
for v_z = -90 to 67.5 step 22.5
glrotatef(v_x, 1, 0, 0)
glrotatef(v_y, 0, 1, 0)
glrotatef(v_z, 0, 0, 1)
gltranslatef (v_xd#, v_yd#, v_zd#)
gosub cube
next
next
next
swapbuffers()
glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT)
waittimer(20)
goto here:
cube:
glBegin(GL_QUADS)
' Front face
glTexCoord2f(0.0, 0.0): glVertex3f(-10, -10, 10) ' Bottom left of the texture and quad
glTexCoord2f(10, 0.0): glVertex3f( 10, -10, 10) ' Bottom right of the texture and quad
glTexCoord2f(10, 10): glVertex3f( 10, 10, 10) ' Top right of the texture and quad
glTexCoord2f(0.0, 10): glVertex3f(-10, 10, 10) ' Top left of the texture and quad
glEnd()
return
Move the mouse to move the view
explore the thing you can even view inside it.
After a short length of time it will "explode"
This is a bit diffrent each time it happens and genrally best viewed from furthest away.