its sort of the wrong forum area to ask the question.
you can use a distance function
function getdist(obj1x#,obj2x#,obj1y#,obj2y#,obj1z#,obj2z#)
distance# = SQRT((obj1x#-obj2x#)^2+(obj1y#-obj2y#)^2+(obj1z#-obj2z#)^2)
endfunction distance#
or a within visible screen command
OBJECT IN SCREEN
This command will return a value of one if the specified 3D object is wholly or partly visible within the screen
borders, otherwise zero is returned. Even if the object is behind the camera, its overall size may partially clip
the screen area. The parameter should be specified using an integer value.
SYNTAX
Return Integer=OBJECT IN SCREEN(Object Number)