Here we go!
Sync On : Sync Rate 30 : Hide Mouse
Make Matrix 1,1000,1000,50,50 : Make Object Cone 1,50 : Color Object 1,rgb(0,255,0)
Position Camera 500,500,-500 : Rotate Camera 20,0,0
Do
if mouseclick()=0 then X#=X#+mousemovex() : Z#=Z#-mousemovey()
Y#=get ground height(1,X#,Z#) : position object 1,X#,Y#,Z#
if mouseclick()=1
if X#<1001 and Z#<1001 and X#>-1 and Z#>-1
set matrix height 1,(X#/20),(Z#/20),Y#
position object 1,X#,Y#,Z#
Y#=Y#-mousemovey()
endif
endif
if inkey$()="s" then gosub save
Sync : Loop
Save:
dim mtx(1,50,50)
for x=0 to 50 : for z=0 to 50
mtx(1,x,z)=get matrix height(1,x,z)
next x : next z
return
I think that works.
I didn't have Dark Basic with me when I typed this.
The load routine is thus:
load:
dim mtx(1,50,50)
for x=0 to 50
for z=0 to 50
set matrix height 1,x,z,mtx(1,x,z)
next x
next z
return
I have now finished level editor 3d and will probably post a link soon.
Current Projects: 'Level Editor 3D' and 'Animation Package v2.0'
aneale5@orange.esinet.org.uk