Well actually I meant the x1,y1,z1,x2,y2,z2 as the space defining where the box was within.
Wrote a short function and some demo code.
Rem Project: Dark Basic Pro Project
Rem Created: Tuesday, August 31, 2010
Rem ***** Main Source File *****
sync on
sync rate 60
make object cube 1,1
position camera 0,0,-5
do
position object 1,object position x(1)+(rightkey()-leftkey())/10.0,object position y(1)+(upkey()-downkey())/10.0,0
if ObjectWithin(1,1,1,1,-1,-1,-1)=1 then text 0,50,"Object within space." else text 0,50,"Object not within space."
text 0,0,"Use the arrowkeys to move the object."
text 0,20,"X: "+str$(Object position x(1))
text 0,30,"Y: "+str$(Object position y(1))
text 0,40,"Z: "+str$(Object position z(1))
sync
loop
Function ObjectWithin(Obj,x1,y1,z1,x2,y2,z2)
SideWidth#=object size x(obj)/2.0
SideHeight#=object size y(obj)/2.0
SideDepth#=object size z(obj)/2.0
if object position x(obj)+SideWidth#<x1 and object position x(obj)-SideWidth#>x2
if object position y(obj)+SideHeight#<y1 and object position y(obj)-SideHeight#>y2
if object position z(obj)+SideDepth#<z1 and object position z(obj)-SideDepth#>z2
Inside=1
endif
endif
endif
Endfunction Inside
My computer surpasses all the technologies of the day. What computer do I have?