A good way to create a river?

Blitz3D Forums/Blitz3D Beginners Area/A good way to create a river?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

How about using a curved mesh as a river ?
Graphics3D 800, 600, 0, 2
SetBuffer BackBuffer()

;create texture
water=CreateTexture(256,256)
Color 0, 0, 64
Rect 0, 0, 256, 256
Color 255,255,255
For j = 0 To 256 Step 10
For i = 0 To 256
Line i, Sin(i * 4) * 5 + j, i - 1, Sin((i - 1) * 4) * 5 + j
Next
Next
CopyRect 0,0,256,256,0,0,BackBuffer(),TextureBuffer(water)

;create river
mesh = CreateMesh()
s = CreateSurface(mesh)
For i = 0 To 30

	x1# = Sin(i * 12) / 4.0
	x2# = x1 + 0.5
	v# = (i / 30.0)
	y#=(i-15)/15.0
	
	If i > 0 Then
		v0 = AddVertex(s, x1, y, 0,0,v)
		v1 = AddVertex(s, x2, y, 0,1,v)
		v2 = AddVertex(s, ox2#, oy#, 0,1,ov#)
		v3 = AddVertex(s, ox1#, oy#, 0,0,ov#)
		AddTriangle s, v0,v1,v2 
		AddTriangle s, v0,v2,v3
	End If
	
	ox1#=x1#
	ox2#=x2#
	ov#=v
	oy#=y
	
Next
EntityTexture mesh,water
EntityFX mesh, 1

cam = CreateCamera()
MoveEntity cam, 0, 0, -2

t#=0
Repeat

	t=t+0.01
	PositionTexture water,0,t
	RenderWorld()
	Flip

Until KeyHit(1)

End