When everything is finished, I'll include the source for the demos.
But for now, it would only confuse things as I haven't decided on the exact format of the main particle generator program data files and people would only use the unfinished routines.
When the finished program is released, the routines would then be incompatible and users would complain that their code didn't work any more!
However, the water effect in the demo is no big secret - it's just an animated ghosted matrix which is updated once each runthrough of the main program loop.
I also use a normalise routine as well to give the light 'shimmering' effect, so you can add that yourself if you like.
Here's the source and the image required is also attached:
Rem Simple Water Matrix By TDK_Man - Aug 2005
SET DISPLAY MODE 800,600,16
Hide Mouse
CLS 0
Sync On
Sync
Sync Rate 60
AutoCam Off
MatWidth = 5000
MatHeight = 5000
MatTilesX = 60
MatTilesZ = 60
MatNum = 6
Dim MatrixAnim(2,MatTilesX,MatTilesZ)
Rem Image For Water And Sea Bed
Load Image "Water.bmp",1
Rem Create Sea Bed Floor Matrix
Make Matrix 1,MatWidth,MatHeight,MatTilesX,MatTilesZ
Prepare Matrix Texture 1,1,1,1
Rem Create Sea Matrix
Make Matrix MatNum,MatWidth,MatHeight,MatTilesX,MatTilesZ
Prepare Matrix Texture MatNum,1,1,1
Ghost Matrix on MatNum
Position Matrix MatNum, 0.0, 100.0, 0.0
Rem Position Camera
Position Camera 2600, 150.0, 0.0
Point Camera MatWidth/2, 0.0, MatHeight/2
Set Camera Range 1.0, 10000.0
Rem Main Loop
Do
Gosub Water
Sync
Loop
Rem Animate Matrix Surface To Look Like Water
Water:
For MatZ = 0 To MatTilesZ
For MatX = 0 To MatTilesX
C = MatrixAnim(1,MatX,MatZ)
If C < 1
MatrixAnim(0,MatX,MatZ) = Rnd(8)
MatrixAnim(2,MatX,MatZ) = Rnd(3)
Endif
A = MatrixAnim(0,MatX,MatZ)
B = MatrixAnim(2,MatX,MatZ)
Set Matrix Height MatNum, MatX, MatZ, A * Sin(C)
Inc C,B
MatrixAnim(1,MatX,MatZ) = Wrapvalue(C)
Next MatX
Next MatZ
Update Matrix MatNum
Return
I used 6 for the matrix number of the water in my example, though if your own program uses matrix 1, then the water can be 2, 3 or whatever you want.
The matrix animation code, I converted from some C code I came across many years ago, so it's not 100% mine. I can't see any problems if anyone else wants to use it though.
TDK_Man