With forum search : "3D mouse" i found this thread :
http://forum.thegamecreators.com/?m=forum_view&t=92386&b=6
Added few lines to the code.I hope it helps.
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 texta
gosub move_cursor
if mouseclick()= 1 and mouseflag = 0
mouseflag = 1
new_build = find free object()
make object cube new_build,1
position object new_build,object position x(1),object position y(1),object position z(1)
endif
if mouseclick()= 0 and mouseflag = 1
mouseflag = 0
endif
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
You can try similar concept for building in your game.
Coding is My Kung Fu!
And My Kung Fu is better than Yours!