Perhaps I've misunderstood what you're looking for. Here's a little demo that showcases my function. It makes some objects and keeps them in the same spot on the screen regardless of the camera's orientation:
set display mode 1024, 768, 32, 1
sync on
autocam off
hide mouse
`Make some objects to orbit around the camera
make object box 1, 1, 1, 3
make object sphere 2, 1
make object cone 3, 1
`Make some ground
make matrix 1, 200, 200, 20, 20
position camera 0, 50, 4, 50
yrotate camera 0, 45
do
set cursor 0,0
print "Mouse - Look"
print "WASD - Strafe"
`Mouse Look
xrotate camera 0, wrapvalue(camera angle x(0) + mousemovey() / 5.0)
yrotate camera 0, wrapvalue(camera angle y(0) + mousemovex() / 5.0)
`WASD Strafe
if keystate(17) then position camera 0, camera position x(0) + 0.5 * sin(camera angle y(0)), 4, camera position z(0) + 0.5 * cos(camera angle y(0))
if keystate(31) then position camera 0, camera position x(0) - 0.5 * sin(camera angle y(0)), 4, camera position z(0) - 0.5 * cos(camera angle y(0))
if keystate(30) then position camera 0, camera position x(0) + 0.5 * sin(camera angle y(0) - 90), 4, camera position z(0) + 0.5 * cos(camera angle y(0) - 90)
if keystate(32) then position camera 0, camera position x(0) + 0.5 * sin(camera angle y(0) + 90), 4, camera position z(0) + 0.5 * cos(camera angle y(0) + 90)
`Position the objects around the camera
OrbitCamera(0, 1, -2.5, 0, 6, 0, 0, 0, 0) `Box
OrbitCamera(0, 2, 2.5, -1.5, 5, 0, 0, 0, 0) `Sphere
OrbitCamera(0, 3, 0.75, 1.5, 4.5, -120, 0, 20, 0) `Cone
sync
loop
end
function OrbitCamera(Camera, Object, ViewXPos as float, ViewYPos as float, ViewZPos as float, ViewXAng as float, ViewYAng as float, ViewZAng as float, DisableZDepth)
position object Object, camera position x(Camera), camera position y(Camera), camera position z(Camera)
rotate object Object, camera angle x(Camera), camera angle y(Camera), camera angle z(Camera)
move object right Object, ViewXPos
move object up Object, ViewYPos
move object Object, ViewZPos
pitch object down Object, ViewXAng
turn object right Object, ViewYAng
roll object left Object, ViewZAng
if DisableZDepth then disable object zdepth Object
endfunction
