I have created a simple program that allows you to walk on a planet (the plains are ment to be clouds).
There are 2 modes:
1) Viewing. hold right mousebutton and move mouse to rotate camera. press space to go to the second mode.
2) Walking. Use arrow keys to move and move mouse to roatate camera. Cannot go back to the 1st mode.
sync on
sync rate 30
set camera range 1,1000000
autocam off
set display mode 800,600,32
make object sphere 1,1000
make object sphere 2,300
moont#=rnd(360)
moonp#=rnd(360)
pitch object up 2,moont#
turn object right 2,moonp#
move object 2,1500
dim atmosphere#(4)
remstart
0=nitrogen
1=oxygen
2=carbon dioxide
3=water vapour
4=dust
remend
dim clouds#(1000,2)
for t=3 to 100
make object plain t,100,100
ghost object on t
position object t,0,0,0
clouds#(t,0)=rnd(360)
clouds#(t,1)=rnd(360)
clouds#(t,2)=rnd(50)
pitch object up t,clouds#(t,0)
turn object right t,clouds#(t,1)
move object t,490
next t
zoom#=10000
do
for t=3 to 100
position object t,0,0,0
clouds#(t,0)=wrapvalue(clouds#(t,0)+0.1)
clouds#(t,1)=wrapvalue(clouds#(t,1)+0.1)
rotate object t,0,0,0
pitch object up t,clouds#(t,1)
turn object right t,clouds#(t,0)
move object t,490+25+clouds#(t,2)
point object t,0,0,0
next t
position object 2,0,0,0
moont#=wrapvalue(moont#+0.01)
moonp#=wrapvalue(moonp#+0.01)
rotate object 2,0,0,0
pitch object up 2,moonp#
turn object right 2,moont#
move object 2,1500
rem camera
if mousemovez()>ommz# and zoom#>600 then zoom#=zoom#-(zoom#/10)
if mousemovez()<ommz# and zoom#<10000 then zoom#=zoom#+(zoom#/10)
ommz#=mousemovez()
position camera 0,0,0
oldcAY# = cAY#
oldcAX# = cAX#
if upkey()=1 then cAx#=wrapvalue(cAx#+5)
if downkey()=1 then cAx#=wrapvalue(cAx#-5)
if leftkey()=1 then cAy#=wrapvalue(cAy#+5)
if rightkey()=1 then cAy#=wrapvalue(cAy#-5)
if mouseclick()=2
cAY# = WrapValue(cAY#+MousemoveX()*0.2)
cAX# = WrapValue(cAX#+MousemoveY()*0.2)
endif
YRotate camera CurveAngle(cAY#,oldcAY#,24)
XRotate camera CurveAngle(cAX#,oldcAX#,24)
yrotate camera cay#
xrotate camera cax#
move camera zoom#*-1
if spacekey()=1 then exit
sync
loop
make object cone 1000,10
position object 1000,0,0,0
angle#=rnd(360)
pitch#=rnd(360)
pitch object up 1000,pitch#
turn object right 1000,angle#
move object 1000,490
zoom#=100
do
for t=3 to 100
position object t,0,0,0
clouds#(t,0)=wrapvalue(clouds#(t,0)+0.1)
clouds#(t,1)=wrapvalue(clouds#(t,1)+0.1)
rotate object t,0,0,0
pitch object up t,clouds#(t,1)
turn object right t,clouds#(t,0)
move object t,490+25+clouds#(t,2)
next t
position object 2,0,0,0
moont#=wrapvalue(moont#+0.01)
moonp#=wrapvalue(moonp#+0.01)
rotate object 2,0,0,0
pitch object up 2,moonp#
turn object right 2,moont#
move object 2,1500
position object 1000,0,0,0
speed#=0.25
if upkey()=1
cayw#=wrapvalue(cay#)
pitch#=wrapvalue(pitch#+(cos(cayw#)*speed#))
angle#=wrapvalue(angle#+(sin(cayw#)*speed#))
endif
if downkey()=1
cayw#=wrapvalue(cay#+180)
pitch#=wrapvalue(pitch#+(cos(cayw#)*speed#))
angle#=wrapvalue(angle#+(sin(cayw#)*speed#))
endif
if rightkey()=1
cayw#=wrapvalue(cay#+90)
pitch#=wrapvalue(pitch#+(cos(cayw#)*speed#))
angle#=wrapvalue(angle#+(sin(cayw#)*speed#))
endif
if leftkey()=1
cayw#=wrapvalue(cay#+270)
pitch#=wrapvalue(pitch#+(cos(cayw#)*speed#))
angle#=wrapvalue(angle#+(sin(cayw#)*speed#))
endif
rotate object 1000,0,0,0
pitch object up 1000,pitch#
turn object right 1000,angle#
move object 1000,490
pitch object down 1000,90
x#=object position x(1000)
y#=object position y(1000)
z#=object position z(1000)
turn object right 1000,cay#
rem camera
if mousemovez()>ommz# and zoom#>6 then zoom#=zoom#-(zoom#/10)
if mousemovez()<ommz# and zoom#<1000 then zoom#=zoom#+(zoom#/10)
ommz#=mousemovez()
position camera x#,y#,z#
oldcAY# = cAY#
oldcAX# = cAX#
cAY# = WrapValue(cAY#+MousemoveX()*0.2)
cAX# = WrapValue(cAX#+MousemoveY()*0.2)
YRotate camera CurveAngle(cAY#,oldcAY#,24)
XRotate camera CurveAngle(cAX#,oldcAX#,24)
set camera to object orientation 1000
pitch camera down cax#
move camera zoom#*-1
sync
loop
It is far from perfect for there are areas which you don't seem to be able to enter. Can you please help me to solve this problem and tell me how to imporve it.