Thanks chafari that is exactly it. I took the example of
GetscreenXFrom3D from the help section here:
https://www.appgamekit.com/documentation/Reference/3D/GetScreenXFrom3D.htm
And modified it to test the theory, just what I needed.
// set the resolution
SetVirtualResolution(800,480)
// create 2 cubes
CreateObjectBox(1,20,20,20) // the moving cube
CreateObjectBox(2,20,20,20) // the stationary cube
SetObjectPosition(2,20,50,60)
// position and point the camera
SetCameraPosition(1,0,150,-300)
SetCameraLookAt(1,0,0,0,0)
do
// this bit of code makes object 1 move in a circle, centered on the 0,0,0 point
SetObjectPosition(1,0,0,0)
RotateObjectLocalY(1,1)
MoveObjectLocalZ(1,50)
// translate the 2 cubes 3D coordinates to 2D screen coordinate
screen_x# = GetScreenXFrom3D(GetObjectX(1),GetObjectY(1),GetObjectZ(1)) // moving cube
screen_y# = GetScreenYFrom3D(GetObjectX(1),GetObjectY(1),GetObjectZ(1))
screen_xx# = GetScreenXFrom3D(GetObjectX(2),GetObjectY(2),GetObjectZ(2)) // stationary cube
screen_yy# = GetScreenYFrom3D(GetObjectX(2),GetObjectY(2),GetObjectZ(2))
// draw 2d line connecting the two 3D objects
drawline(screen_x#,screen_y#, screen_xx#,screen_yy#,50,255,255)
sync()
loop
Thanks again.