Quote: "when i move the mouse up the object goes down"
use +number# not -number# or vice versa.
and mousex() is a integer not a float so this mousex#=mousex()
is unnessesary. mouseposx=mousex() is better for the performance.
And you must know that the 2d y position start at top and go to the
bottom. If you See a 3d scence from the top the 3d z posion start at the bottom and go to the top.
this is the correct code.
`declaring variables
displayx=800
displayy=600
camerax#=displayx/2
cameray#=502.5
cameraz#=displayy/2
mousex#=400
mousey#=300
posx#=400
posz#=300
`setup display
set display mode displayx,displayy,16
sync on : sync rate 40
autocam off
set mipmap mode 2
backdrop on
color backdrop 0
`make the matrix
make matrix 1,displayx,displayy,5,5
`set the camera
position camera camerax#,cameray#,cameraz#
point camera displayx/2,0,displayy/2
`player ball
make object sphere 1,50
`main loop
do
set cursor 10,10 : print "mx",mousex()
set cursor 10,20 : print "my",mousey()
set cursor 10,30 : print "ox",object position x(1)
set cursor 10,40 : print "oy",object position z(1)
mouseposx=mousex()
mouseposy=mousey()
rem posx#=mousex# unimportant
rem posz#=mousey# "
position object 1,mouseposx,0,-mouseposy+displayy-1
sync
loop
EDIT: Ops this is the DBC board.
-number# will only work in DBP
you shounld use number#*-1
here is the code for DBC:
`declaring variables
displayx=800
displayy=600
camerax#=displayx/2
cameray#=502.5
cameraz#=displayy/2
mousex#=400
mousey#=300
posx#=400
posz#=300
`setup display
set display mode displayx,displayy,16
sync on : sync rate 40
autocam off
set mipmap mode 2
backdrop on
color backdrop 0
`make the matrix
make matrix 1,displayx,displayy,5,5
`set the camera
position camera camerax#,cameray#,cameraz#
point camera displayx/2,0,displayy/2
`player ball
make object sphere 1,50
`main loop
do
set cursor 10,10 : print "mx",mousex()
set cursor 10,20 : print "my",mousey()
set cursor 10,30 : print "ox",object position x(1)
set cursor 10,40 : print "oy",object position z(1)
mouseposx=mousex()
mouseposy=mousey()
fy=(mouseposy-displayy-1)*-1
fx=mouseposx
position object 1,fx,0,fy
sync
loop