Ok, i have been screwing around with the code, no luck but I may have figured out that i need to insert this code --
Gosub Setup
Do
Gosub ReadMouse
sync
Ink RGB(55,55,55),0
Text 5,1,"Flying Over Never Ending Matrix - By TDK_Man (August 2005)"
Loop
Setup:
Set Display Mode 800,600,16
Hide Mouse
Sync On
Backdrop On
Color Backdrop RGB(200,200,255)
Randomize Timer()
TilesX=50: TilesZ=50: Tilesize#=2048.0: MatZPos#=0.0
Create Bitmap 1,128,128
CLS RGB(0,50,0)
For T=1 To 5000
M=Rnd(150)+50
Ink Rgb(0,M,0),0
Dot Rnd(128),Rnd(128)
Next T
Get Image 1,0,0,127,127
Delete Bitmap 1
MatWidth#=TilesX*Tilesize#: MatHeight#=TilesZ*Tilesize#
MatCentreX#=MatWidth#/2.0: MatCentreZ#=MatHeight#/2.0
Make Matrix 1,MatWidth#,MatHeight#,TilesX,TilesZ
PREPARE MATRIX TEXTURE 1,1,1,1
Randomize Matrix 1,5000
Gosub Smooth
For N = 1 To 20
X=Rnd(TilesX-2)+1: Z=Rnd(TilesZ-2)+1
Set Matrix Height 1,x,z,10000
Set Matrix Height 1,x-1,z-1,6000
Set Matrix Height 1,x+1,z+1,7000
Set Matrix Height 1,x+1,z-1,8000
Set Matrix Height 1,x-1,z+1,9000
Next N
For N = 0 To TilesX
Set Matrix Height 1,N,0,Get Matrix Height(1,N,TilesZ)
Next N
For N=1 To 10
Gosub Smooth
Next N
Gosub Normalise
Fog Distance 50000
FOG COLOR RGB(200,200,255)
Fog On
Set Camera Range 100.0, 1000000.0
Position Camera MatCentreX#, 2500.0, MatCentreZ#
Rotate Camera 0.0,0.0,0.0
Return
ReadMouse:
CX#=CAMERA ANGLE X(): CY#=CAMERA ANGLE Y(): CZ#=CAMERA ANGLE Z()
CX#=Wrapvalue(CX# + mousemovey() )
CY#=Wrapvalue(CY# + mousemovex() )
Rotate Camera CX#,CY#,CZ#
If MatZPos# > (0-Tilesize#)
Dec MatZPos#,256.0
Else
MatZPos# = -256.0
SHIFT MATRIX Up 1
MatZPos# = 0.0
Endif
Position Matrix 1, 0.0, 0.0, MatZPos#
Return
Normalise:
Rem By Lee Bamber From DB Example - Adds shaded areas to matrix to give depth
For z=1 to TilesZ
For x=1 to TilesX
h8#=get matrix height(1,x,z-1)
h4#=get matrix height(1,x-1,z)
h#=get matrix height(1,x,z)
h2#=get matrix height(1,x,z)
x1#=(x-1)*25.0
y1#=h#
x2#=(x+0)*25.0
y2#=h4#
dx#=x2#-x1#
dy#=y2#-y1#
ax#=atanfull(dx#,dy#)
ax#=wrapvalue(90-ax#)
z1#=(z-1)*25.0
y1#=h2#
z2#=(z+0)*25.0
y2#=h8#
dz#=z2#-z1#
dy#=y2#-y1#
az#=atanfull(dz#,dy#)
az#=wrapvalue(90-az#)
nx#=sin(ax#)
ny#=cos(ax#)
nz#=sin(az#)
Set matrix normal 1,x,z,nx#,ny#,nz#
next x
next z
Update Matrix 1
Return
Rem **************************************************
Rem Smooth Matrix
Rem **************************************************
Smooth:
Rem Averages matrix heights to remove jagged edges
For Z=0 to TilesZ
For X=0 to TilesX
P0#=Get Matrix Height(1,X,Z): Rem Current point height
Rem Get 4 adjoining points heights (if they exist)
If Z-1 > 0
P1#=Get Matrix Height(1,X,Z-1)
Else
P1#=Get Matrix Height(1,X,TilesZ)
Endif
If X+1 < TilesX
P2#=Get Matrix Height(1,X+1,Z)
Else
P2#=Get Matrix Height(1,0,Z)
Endif
If Z+1 < TilesZ
P3#=Get Matrix Height(1,X,Z+1)
Else
P3#=Get Matrix Height(1,X,0)
Endif
If X-1 > 0
P4#=Get Matrix Height(1,X-1,Z)
Else
P4#=Get Matrix Height(1,TilesX,Z)
Endif
Average#=(P0#+P1#+P2#+P3#+P4#)/5: Rem Av height of other points
Set Matrix Height 1,x,z,Average#
Next x
Next z
Return
Somewere in this part of my code.
--
*********Movement Contorls******************
Set camera to follow Object position X(1),Object position Y(1),Object position Z(1),Object angle Y(1),500,100,5,0
If upkey()=1 then Xrotate object 1,Wrapvalue(Object angle X(1)+1)
If downkey()=1 then Xrotate object 1,Wrapvalue(Object angle X(1)-1)
if Upkey()=0
If Downkey()=0
NewX#=Curveangle(0,Object angle X(1),100)
Xrotate object 1,NewX#
endif
endif
`*******Auto Move Take away if then statment**********
if keystate (17)=1 then move object 1,20
`**************************
If rightkey()=1 then Yrotate object 1,wrapvalue(Object Angle Y(1)+2)
If leftkey()=1 then Yrotate object 1,wrapvalue(Object Angle Y(1)-2)
set cursor 0,0
Print Scancode()
`************************************************
Sync
Loop
End: `*** End Of Main Program ***
So im taking it that the shift matrix command has to be somewhere in the Control Movement code??
http://www.Bevansfunbox.com