And here's a simple solution in code.
Rem Project: Dark Basic Pro Project
Rem Created: Friday, June 15, 2012
Rem ***** Main Source File *****
sync on : sync rate 60 : sync
set display mode 640, 480, 32, 1
// make two cubes and a sphere
make object cube 1, 100
make object cube 2, 100
make object sphere 3, 100
// position the two cubes so that one is 'higher' than the other
position object 1, -200, -100, 0
position object 2, 200, 100, 100
// position the sphere halfway inbetween the two objects
x# = ( Object Position X(1) + Object Position X(2) ) / 2.0
y# = ( Object Position Y(1) + Object Position Y(2) ) / 2.0
z# = ( Object Position Z(1) + Object Position Z(2) ) / 2.0
position object 3, x#, y#, z#
position camera 0,0,-400
do
control camera using arrowkeys 0, 1, 0.5
sync
loop
Basically, say we have point O(x1, y1, z1) and point P(x2, y2, z2).
The midpoint M is ( (x1 + x2)/2 , (y1 + y2)/2, (z1 + z2)/2 ).