Ok, that's what I thought initially. Which is why I posted this previously,
if OBJECT IN SCREEN(Sphere1)
X = OBJECT SCREEN X(Sphere1)
Y = OBJECT SCREEN Y(Sphere1)
DOT X, Y
endif
That puts a DOT on the screen where your Sphere1 is.
Do the same thing for Sphere2.
Then do the LINE command using the X and Y of both of those dots.
[edit]
Here is a full example, drawing a line between 2 3D objects.
sync on : sync rate 0
make object sphere 1, 5
color object 1, rgb(255,0,0)
position object 1, 0, -50, 0
make object sphere 2, 5
color object 2, rgb(255,0,0)
position object 2, 0, 50, 0
position camera 0, 0, 0, -100
point camera 0, 0, 0, 0
while not escapekey()
if object in screen(1)
x1# = object screen x(1)
y1# = object screen y(1)
endif
dot x1#, y1#, rgb(0,255,0)
if object in screen(2)
x2# = object screen x(2)
y2# = object screen y(2)
endif
dot x2#, y2#, rgb(0,255,0)
line x1#, y1#, x2#, y2#, rgb(255,255,255)
sync
endwhile