if you dont have it, go here to get "Caustics Generator"
http://www.lysator.liu.se/~kand/caustics/
create some caustic images animation with 32 frames and with Black background. (preferably 256x256 in size)
Save the images to output directory with name "caustics", program will generate 32 images with names "caustics_001.bmp" to "caustics_032.bmp"
pick these images and an extra "ground.bmp" image to the same folder to make the following code work. you can change the directories to your wish.
Code:
Rem Project: Caustics
Rem Created: 04.03.2005 12:53:06
Rem ***** Main Source File *****
REM LOAD IMAGES
for a = 1 to 9
img = free_image()
LOAD IMAGE "caustics_00"+str$(a)+".bmp", img, 1
next a
for a = 10 to 32
img = free_image()
LOAD IMAGE "caustics_0"+str$(a)+".bmp", img, 1
next a
make object plain 10,1000,1000
xrotate object 10,90
`ghost object on 10,0
`set object transparency 10,4
`set alpha mapping on 10,100
img = free_image()
load image "ground.bmp",img
GOSUB Camera_Setup
REM MAKE THE GROUND
position object objCamera, 0, 100, 0
SYNC ON
DO
a# = a# + 0.1
if a# => 32 then a# = 1
texture object 10,a#
set detail mapping on 10,img
GOSUB camera_Free_Loop
SYNC
LOOP
`---------CAMERA DUMMY OBJECT----------
Camera_Setup:
objCamera = free_object()
MAKE OBJECT BOX objCamera, 5, 5, 5 : HIDE OBJECT objCamera
camMoveSpeed# = 1.0
RETURN
`---------PROGRAM CAMERA LOOP----------
camera_Free_Loop:
if shiftkey() > 0
inc camMoveSpeed#, 0.1
if camMoveSpeed# => 10.0 then camMoveSpeed# = 10.0
else
if camMoveSpeed# > 1.0
dec camMoveSpeed#, 0.1
if camMoveSpeed# =< 1.0 then camMoveSpeed# = 1.0
endif
endif
if keystate(17)=1 then MOVE OBJECT objCamera, camMoveSpeed#
if keystate(30)=1 then MOVE OBJECT LEFT objCamera, camMoveSpeed#
if keystate(31)=1 then MOVE OBJECT objCamera, -camMoveSpeed#
if keystate(32)=1 then MOVE OBJECT RIGHT objCamera, camMoveSpeed#
rem camera rotation
camAngX# = wrapvalue((mousemovey() / 2.0) + camAngX#)
camAngY# = wrapvalue((mousemovex() / 2.0) + camAngY#)
rem stops mouse from going upside down
if camAngX# > 80 and camAngX# < 180 then camAngX# = 80
if camAngX# > 180 and camAngX# < 310 then camAngX# = 310
ROTATE OBJECT objCamera, camAngX#, camAngY#, object angle z(objCamera)
camPosX# = object position x(objCamera)
camPosY# = object position y(objCamera)
camPosZ# = object position z(objCamera)
camAngX# = object angle x(objCamera)
camAngY# = object angle y(objCamera)
camAngZ# = object angle z(objCamera)
POSITION CAMERA 0, camPosX#, camPosY#, camPosZ#
ROTATE CAMERA 0, camAngX#, camAngY#, object angle z(objCamera)
RETURN
`---------------------------------------------------------
Function free_image()
Repeat
Inc i
Until Image Exist(i) = 0
EndFunction i
`---------------------------------------------------------
Function free_object()
Repeat
Inc i
Until Object Exist(i) = 0
EndFunction i
`---------------------------------------------------------