sync on
sync rate 60
set window off
hide mouse
make camera 1
position camera 1,0,0,0
backdrop on
color backdrop rgb(255,0,0)
make object box 1,10,25,10
position object 1,0,0,0
make object cube 2,20
position object 2,50,0,0
make object cube 3,20
position object 3,-50,-5,0
make object cube 4,20
position object 4,50,0,50
make object cube 5,20
position object 5,50,-10,-50
make object cube 6,20
position object 6,-50,0,-50
make object cube 7,20
position object 7,75,20,-20
position mouse screen width() / 2, screen height() / 2
mx# = mousex()
my# = mousey()
mz# = mousez()
do
position mouse screen width() / 2, screen height() / 2
x# = object position x(1)
y# = object position y(1)
z# = object position z(1)
ax# = object angle x(1)
ay# = object angle y(1)
az# = object angle z(1)
if mousex() > mx#
else
mx# = mx# + (mousex() - mx#)
endif
if mousex() < mx#
else
mx# = mx# + (mousex() - mx#)
endif
ay# = mx#
position object 1,x#,y#,z#
rotate object 1,ax#,ay#,az#
position camera 1,x#,y#,z#
rotate camera 1,ax#,ay#,az#
text 1,1,str$(mx#)
text 1,11,str$(my#)
sync
loop
It works when I remove the positioning of the mouse, but only until it hits a corner of the screen.
Always program as if the person maintaining your program is a psychopath that knows where you live