make matrix 1,1000,1000,25,25
autocam off
position camera 0,50,0
point camera 20,0,20
make object sphere 1,5
sync on
sync rate 0
angle# = 0
do
gosub camera
gosub text
gosub move_cursor
sync
loop
camera:
if leftkey()=1
angle# = wrapvalue(angle# - 1)
endif
if rightkey()=1
angle# = wrapvalue(angle# + 1)
endif
yrotate camera angle#
return
move_cursor:
if angle# < 70
if mousex() < object screen x(1)
position object 1,object position x(1)-1,object position y(1),object position z(1)
endif
if mousex() > object screen x(1)
position object 1,object position x(1)+1,object position y(1),object position z(1)
endif
if mousey() > object screen y(1)
move object 1,-1
endif
if mousey() < object screen y(1)
move object 1,1
endif
endif
if angle# >= 70 and angle# < 170
if mousex() < object screen x(1)
move object 1,1
endif
if mousex() > object screen x(1)
move object 1,-1
endif
if mousey() > object screen y(1)
position object 1,object position x(1)-1,object position y(1),object position z(1)
endif
if mousey() < object screen y(1)
position object 1,object position x(1)+1,object position y(1),object position z(1)
endif
endif
if angle# >= 170 and angle# < 260
if mousex() < object screen x(1)
position object 1,object position x(1)+1,object position y(1),object position z(1)
endif
if mousex() > object screen x(1)
position object 1,object position x(1)-1,object position y(1),object position z(1)
endif
if mousey() > object screen y(1)
move object 1,1
endif
if mousey() < object screen y(1)
move object 1,-1
endif
endif
if angle# >= 260
if mousex() < object screen x(1)
move object 1,-1
endif
if mousex() > object screen x(1)
move object 1,1
endif
if mousey() > object screen y(1)
position object 1,object position x(1)+1,object position y(1),object position z(1)
endif
if mousey() < object screen y(1)
position object 1,object position x(1)-1,object position y(1),object position z(1)
endif
endif
return
text:
set cursor 0,0
print "camera angle y: ",camera angle y()
print "object angle y: ",object angle y(1)
return
i'm not 100% sure if this has been posted before but as i couldn't
find a working 360 degree mouse i had to develop one off a code that worked for up to 70 degrees
it works in 360 degrees and at slainted cameras note the object has an radius of 5 so i can see it
note makeing it 360 degrees was made from me but the original 70 degree working 3d mouse is from someone else as i can't remeber his name or find the link if i do i well modify this to add his name
note sorry for any misspelling and hope this helps people for any of the games that require 360 degree working mouses=-) also i only have teseted it at the slaint that you see i'm not sure how well it works at higher/lower slaints
my smiles love me =-)=-)=-)(-=(-=(-=