I want to be able like I said to control this target around the matrix, I already make it go around the matrix, but on the right and front side when the target goes on the wrong direction. I want it to go like this:
left side to go from front to back ( this one is correct )
back side to go from left to right ( this one is correct )
right side to go from back to front ( incorrect )
front side to go right to left ( incorrect )
this is my code, you do not need extra media.
`set up
sync rate 40
sync on
autocam off
hide mouse
` make matrix
make matrix 1,160,160,30,30
`make target and color it
make object box 1,6,1,6
xrotate object 1,90
color object 1,rgb(10,10,10)
`main program
do
`get mouse position on x for left,back,right and front
posmousex#=mousex()
posmousexleft#=posmousex#
posmousexback#=posmousex#
posmousexright#=posmousex#
posmousexfront#=posmousex#
`print information on the screen
set cursor 50,250 : print "left side --->"
set cursor 510,250 : print "<--- right side"
set cursor 290,150 : print "back side"
set cursor 290,400 : print "front side"
set cursor 0,0 : print "mouse on x... ",posmousex#
`mouse bounds on x on the left side 0 - 160
if posmousexleft#<1 then posmousexleft#=1
if posmousexleft#>160 then posmousexleft#=160
`mouse bounderies on x on the back side 160 - 320
if posmousexback#<161 then posmousexback#=161
if posmousexback#>320 then posmousexback#=320
`mouse bounds on x on the right side 321-480
if posmousexright#<321 then posmousexright#=321
if posmousexright#>480 then posmousexright#=480
`mouse bounds on x on the front side 480-639
if posmousexfront#<480 then posmousexfront#=480
if posmousexfront#>639 then posmousexfront#=639
` sending if to corresponding positioning left,back,right and front
if posmousexleft#>1 and posmousexleft#<160 then gosub movingmouseonleft
if posmousexback#>161 and posmousexback#<320 then gosub movingmouseonback
if posmousexright#>321 and posmousexright#<480 then gosub movingmouseonright
if posmousexfront#>480 and posmousexfront#<639 then gosub movingmouseonfront
` positioning camera
position camera 80,100,-80
point camera 80,1,80
sync
loop
movingmouseonleft:
`positioning mouse on the left of the matrix 1-160
position object 1,1,2,posmousexleft#
return
movingmouseonback:
`positioning mouse on the back of the matrix 161-320
position object 1,posmousexback#-160,2,160
return
movingmouseonright:
`positioning mouse on the right or the matrix 321-480
position object 1,160,2,posmousexright#-320
return
movingmouseonfront:
`positioning mouse on the front of the matrix 480-639
position object 1,posmousexfront#-480,2,1
return
Thank you for your time.