camera zoom

Blitz3D Forums/Blitz3D Beginners Area/camera zoom

stayne(Posted 2006) [#1]
If my camera zoom is at 1.6, how many degrees is that, and what's the formula to calculate it?


stayne(Posted 2006) [#2]
looks like 90 / camerazoom setting = FOV, but that's my math wizardy at work... and probably wrong?


GfK(Posted 2006) [#3]
Try this:
Graphics3D 800,600
zoom# = 1
cam = CreateCamera()
cube = CreateCube()
light = CreateLight()
MoveEntity cam,0,5,-50

While Not KeyDown(1)
	If KeyDown(200) Then zoom = zoom + 0.1
	If KeyDown(208) Then zoom = zoom - 0.1
	If zoom < 1 Then zoom = 1
	CameraZoom cam,zoom
	
	RenderWorld
	Text 0,20,"Cam Zoom: " + zoom
	Text 0,10,"Field of view: " + FieldofView(zoom)
	Flip
Wend

Function FieldOfView#(zoom#)
	Local fov#
	fov = 2 * ATan(1 / zoom)
	Return fov
End Function



stayne(Posted 2006) [#4]
Thanks! I'm at work at the moment. 1.6 = 64 degrees, correct?


GfK(Posted 2006) [#5]
Thanks! I'm at work at the moment. 1.6 = 64 degrees, correct?
Yep.


Mustang(Posted 2006) [#6]
I've always disliked the CameraZoom command, bit too abstract for me, I need degrees. luckily we have this:

http://www.blitzbasic.com/codearcs/codearcs.php?code=676


D4NM4N(Posted 2006) [#7]
what is the angle of human sight? is that about 64'


GfK(Posted 2006) [#8]
what is the angle of human sight? is that about 64'
With peripheral vision its probably nearer to 170 degrees.


Boiled Sweets(Posted 2006) [#9]
Well without a zoom of 1.6 objects appears to get 'squashed' when not directly in front of you.

I want to 'see more' of my world but with lower than 1 zoom causes 'distortion.


GfK(Posted 2006) [#10]
I want to 'see more' of my world but with lower than 1 zoom causes 'distortion.
Yeah setting zoom lower than 1 will cause a fisheye lens/wide angle effect.

Wouldn't recommend doing that as it becomes difficult for the player to judge distance. Useful for a security camera effect though.