hi Red, i read your recent post in general discussion, and suddenly realized that camera position rather than zoom is all that is needed, so i'll credit you with the "out of the box" solution. :)
I did a little test and actually camerazoom is bad, not just because it costs the framerate but because it's technically not right anyway!
camerazoom makes things travel towards orthographic projection which, i think is wrong, in real life there is no orthographic projection, when you looks though binoculars you see what you would see if you were standing closer to the object, so all you need is the maths to position a camera from 3d point A to B then.
I wrote up a quick test actually, just to check what it is like, there's no algo there, just hard-coded values to emulate it but it gives you the impression anyway.
Maybe i'll have a go at the algo too. sounds like fun.
;Zoom test, keys Q/A=camera zoom, W/S=camera position
Graphics3D 640,480,0,2
SetBuffer BackBuffer()
cam=CreateCamera()
light=CreateLight()
RotateEntity light,90,0,0
cube=CreateCube()
PositionEntity cube,0,0,200
While Not KeyHit(1)
UpdateWorld
RenderWorld
If KeyDown(16) ;Q key
zoom#=zoom#+0.1
If zoom#>20 Then zoom#=20
CameraZoom cam,zoom#
EndIf
If KeyDown(30) ;A key
zoom#=zoom#-0.1
If zoom#<1 Then zoom#=1
CameraZoom cam,zoom#
EndIf
If KeyDown(17) ;W key
pos#=pos#+(EntityDistance(cam,cube)/50)
If pos#>190 Then pos#=190
PositionEntity cam,0,0,pos#
EndIf
If KeyDown(31) ;S key
pos#=pos#-(EntityDistance(cam,cube)/50)
If pos#<0 Then pos#=0
PositionEntity cam,0,0,pos#
EndIf
TurnEntity cube,0.4,0.2,0.3
Text 0,0,"camera zoom="+zoom#
Text 0,12,"camera Z mt="+EntityZ(cam)
Flip
Wend