d-man wrote that a long time ago, a method, which is using the intersect object command...
sync on : sync rate 0
set display mode 1024,768,16
hide mouse
ink RGB(0,255,0),0
line 0,12,25,12
line 12,0,12,25
get image 1,0,0,25,25
cls RGB(192,192,192)
ink 0,0
for y=0 to 15
line 0,17*y,256,17*y
for x=0 to 9
if y/2.0=y/2 then line 25.6*x,17*y,25.6*x,17*(y+1) else line 25.6*x+12.8,17*y,25.6*x+12.8,17*(y+1)
next x
next y
get image 2,0,0,256,256
cls
ink 1,0
for r=1 to 3
circle 4,4,r
next r
get image 3,0,0,9,9
make object box 1,5,5,0.1
texture object 1,2
make object sphere 2,2
hide object 2
make object plain 3,0.1,0.1
texture object 3,3
set object transparency 3,1
time=timer()
r#=3000
obj=4
autocam off
do
dt#=(timer()-time)/1000.0
time=timer()
yrotate camera wrapvalue(camera angle y()+mousemovex())
xrotate camera wrapvalue(camera angle x()+mousemovey())
if upkey()=1 then move camera 50*dt#
if downkey()=1 then move camera -50*dt#
sprite 1,screen width()/2-12,screen height()/2-12,1
if mouseclick()=1
mmcoord(screen width()/2,screen height()/2,r#,60)
dist#=intersect object(1,camera position x(),camera position y(),camera position z(),object position x(2),object position y(2),object position z(2))
if dist#>0
i#=dist#/r#
x#=camera position x()+(object position x(2)-camera position x())*i#
y#=camera position y()+(object position y(2)-camera position y())*i#
z#=camera position z()+(object position z(2)-camera position z())*i#
clone object obj,3
if object position x(1)<x# then inc x#,0.0001 else dec x#,0.0001
if object position y(1)<y# then inc y#,0.0001 else dec y#,0.0001
if object position z(1)<z# then inc z#,0.0001 else dec z#,0.0001
position object obj,x#,y#,z#
rotate object obj,object angle x(1),object angle y(1),object angle z(1)
inc obj
endif
endif
sync
loop
function mmcoord(scrx#,scry#,r#,FOV#)
ax#=camera angle x()
ay#=camera angle y()
scrw#=screen width()
scrh#=screen height()
hmax# = r#*tan(FOV#/2)
mh# = (((scrh#/2-scry#)*2)/scrh#)*hmax#
wmax# = r#*scrw#/scrh#*tan(FOV#/2)
mw# = (((scrx#-scrw#/2)*2)/scrw#)*wmax#
cl# = r#*cos(ax#)
ch# = -r#*sin(ax#)
sl# = mh#*cos(90-ax#)
sh# = mh#*sin(90-ax#)
ox# = camera position x() + (cl#+sl#)*sin(ay#) + mw#*cos(ay#)
oy# = camera position y() + (ch#+sh#)
oz# = camera position z() + (cl#+sl#)*cos(ay#) - mw#*sin(ay#)
position object 2,ox#,oy#,oz#
endfunction