Look I managed to get a player object with a lot of help to walk or run on a sphere and to straffe also to look around and turn using mouselook but I can't seem to get the thing to stop spinning on it's axis, can anyone help with this please?
REM *******************************************************************
REM *******************************************************************
REM *******************************************************************
REM *******************************************************************
REM *******************************************************************
REM Player Planetary Test
REM Orginal Code Shawn Bowers of Starwraith3D fame aka Vice (I Think)
rem modifed further by Ian Geore aka Vampyre
REM *******************************************************************
REM *******************************************************************
REM *******************************************************************
REM *******************************************************************
sync on
sync rate 33
autocam off
draw to front
Hide Mouse
rem background star texture
create bitmap 1,256,256
set current bitmap 1
for i = 0 to 1000
s=128+rnd(127)
ink rgb(s,s,s),0
dot rnd(255),rnd(255)
next i
sync
get image 1,0,0,256,256
delete bitmap 1
cls
rem background star object
make object sphere 1,1000
texture object 1,1
scale object texture 1,5,5
set object 1,1,1,0,1,0,0,0
rem planet
make object sphere 2,100
color object 2,rgb(0,255,0)
position object 2,0,0,0
rem hidden guide object
make object plain 47,1,1
hide object 47
rem Object to drive on planet
make object cube 11,1
color object 11,rgb(0,255,255)
rem Rotate and fix data so character faces right way
xrotate object 11,0
yrotate object 11,180
zrotate object 11,0
fix object pivot 11
rem put camera and vehicle object on surface of planet to set started
position object 47,object position x(2),object position y(2),object position z(2)
move object 47,52
position camera object position x(47),object position y(47),object position z(47)
pitch camera down 90
position object 11,camera position x(),camera position y(),camera position z()
set object to camera orientation 11
mainloop:
position object 47,object position x(2),object position y(2),object position z(2)
point object 47,object position x(11),object position y(11),object position z(11)
move object 47,52
position object 11,object position x(47),object position y(47),object position z(47)
xc2#=object position x(11):yc2#=object position y(11):zc2#=object position z(11)
ppx=object position x(2):ppy=object position y(2):ppz=object position z(2)
set object to camera orientation 11
dx#=abs(xc2#-ppx)
dy#=abs(yc2#-ppy)
dz#=abs(zc2#-ppz)
camdist#=sqrt((dx#*dx#)+(dy#*dy#)+(dz#*dz#))
position object 47,xc2#,yc2#,zc2#
set object to camera orientation 47
turn object left 47,90
move object 47,10
gx#=object position x(47)
gy#=object position y(47)
gz#=object position z(47)
dx#=abs(gx#-ppx)
dy#=abs(gy#-ppy)
dz#=abs(gz#-ppz)
rolldist#=sqrt((dx#*dx#)+(dy#*dy#)+(dz#*dz#))
rollhor#=(camdist#-rolldist#)*9.0
roll object right 11,rollhor#
position object 47,xc2#,yc2#,zc#
set object to camera orientation 47
pitch object up 47,90
move object 47,90
gx#=object position x(47)
gy#=object position y(47)
gz#=object position z(47)
dx#=abs(gx#-ppx)
dy#=abs(gy#-ppy)
dz#=abs(gz#-ppz)
topdist#=sqrt((dx#*dx#)+(dy#*dy#)+(dz#*dz#))
if topdist#<camdist# then set object to camera orientation 11:roll object right 11,180-rollhor#
position object 47,xc2#,yc2#,zc2#
set object to camera orientation 47
move object 47,10
gx#=object position x(47)
gy#=object position y(47)
gz#=object position z(47)
dx#=abs(gx#-ppx)
dy#=abs(gy#-ppy)
dz#=abs(gz#-ppz)
pitchdist#=sqrt((dx#*dx#)+(dy#*dy#)+(dz#*dz#))
position object 47,xc2#,yc2#,zc2#
point object 47,plx#,ply#,plz#
move object 47,10
dx#=abs(gx#-ppx)
dy#=abs(gy#-ppy)
dz#=abs(gz#-ppz)
pitchdist#=sqrt((dx#*dx#)+(dy#*dy#)+(dz#*dz#))
pitchor#=(camdist#-pitchdist#)*9.0
pitch object up 11,pitchor#
x#=wrapvalue(x#+mousemovey())
y#=wrapvalue(y#+mousemovex())
z#=wrapvalue(z#+mousemovez())
rotate object 11, x#,y#,z#
If upkey()>0 then move object 11,1
if downkey()>0 then move object 11,-1
if leftkey()>0 then turn object left 11,90:move object 11,1:turn object right 11,90
if rightkey()>0 then turn object right 11,90:move object 11,1:turn object left 11,90
If InKey$() = "1" Then cammode = 1 : ` third person
If InKey$() = "2" Then cammode = 0 : ` first person
If cammode = 0
rem Place camera and set orientation to object for FPS
position camera object position x(11),object position y(11)+0,object position z(11)
set camera to object orientation 11
else
rem put camera behind vehicle object for 3rd person view
position camera object position x(11),object position y(11),object position z(11)
set camera to object orientation 11
pitch camera down 20
move camera -10
endif
sync
goto mainloop: