Here is how to use PICK OBJECT which is used to tell you what object is at a screen co-ordinate (mouse coord usually)
I've never used PICK SCREEN but will have a play now and knock up some code later.
sync on : sync rate 0 : autocam off : randomize timer()
for f=1 to 20
make object cube f,50
position object f,-200+rnd(400),-200+rnd(400),rnd(100)
color object f,rgb(rnd(255),rnd(255),rnd(255))
next f
make object sphere 100,10
position camera -200,0,-500
do
p=pick object(mousex(),mousey(),1,20)
set cursor 0,0
if p=0
print "You are not pointing at any object"
hide object 100
else
pd#=get pick distance()
print "You are pointing at object: ";p
print "Distance from camera: ";pd#
px#=get pick vector x()
py#=get pick vector y()
pz#=get pick vector z()
wx#=px#+camera position x()
wy#=py#+camera position y()
wz#=pz#+camera position z()
print "Relative to Camera: X = ";px#
print "Relative to Camera: Y = ";py#
print "Relative to Camera: Z = ";pz#
print "World: X = ";wx#
print "World: Y = ";wy#
print "World: Z = ";wz#
show object 100
position object 100,wx#,wy#,wz#
endif
sync
loop
[EDIT] Just edited code to place a sphere at 3d coord where mouse hits object.
The programmer formerly known as sonic