before a math guru steps in to solve, try this:
sync on : sync rate 60
dw = desktop width() : dh = desktop height()
set display mode dw,dh,32
autocam off
make object sphere 1,10.0
move object 1, 200.0
`hide object 1
do
if (lastmove + 500) < timer()
position object 1, 0.0, 0.0,0.0
yrotate object 1, rnd(180)-90.0
xrotate object 1, rnd(90)-45.0
move object 1, 200.0
lastmove = timer()
endif
osx = object screen x (1) : osy = object screen y (1)
if osx => 0 and osx < dw and osy => 0 and osy < dh
center text dw/2,20,str$(osx)+" / "+str$(osy)
else
center text dw/2,20,"not on screen"
endif
sync
loop
trust me when i say i did understand your question. your solution was right in front of you all along
changed code to make it a bit more obvious.
also,
object screen x is native dbpro code, or did i miss something?
Virtual Nomad @ California, USA . DBPro V7.7 . Matrix1Utils 05.27.12
AMD Phenomâ„¢ X4 9750 Quad-Core @ 2.4 GHz . 8 GB PC2-6400 RAM
ATI Radeon HD 3650 @ 512 MB . Vista Home Premium 64 Bit