Hi Bluestar4,
Not actually. The SET CAMERA FOV is looking for a value expressed in radians. That is why I put the degrees to radians formula in the previous post:
fov#=(3.14/180)* degrees#
If you substitute degrees# with 62 in this equation, you'll end up with a value of about 1.08 which is 62 represented in radians. So use any degrees < 180 in the formula and use the return value in the SET CAMERA FOV call. If you go above 180, the camera will flip. Experiment to find what works best with whatever you are trying to do.
Here's a scope example that shows how reducing the FOV can produce a zoom in effect, and by increasing the FOV you can make a zoom out effect. Use the mouse to look around, use up arrow and down arrow to move, and click the left mouse button to toggel the scope:
rem quick rifle scope
rem by latch
rem 08/09/2008
rem mouse to look, up/down to move camera, left click to zoom
set display mode 800,600,32
sync on
sync rate 60
autocam off
hide mouse
gosub _init
do
gosub _move_camera
gosub _zoom
text 0,0,"Current camera FOV = "+str$(fov#)
sync
loop
_init:
make matrix 1,5000,5000,25,25
rem make a bunch of objects
for obj=1 to 25
x=rnd(5000)
z=rnd(5000)
make object cube obj,30
position object obj,x,15,z
color object obj,rgb(rnd(255),rnd(255),rnd(255))
next obj
rem make an image to use as a scope view
create bitmap 1,screen width()+1,screen height()+1
cls rgb(20,20,20)
ink 0,0
for r=0 to screen height()/3
circle screen width()/2,screen height()/2,r
circle screen width()/2,(screen height()/2)+1,r
next r
get image 1,0,0,screen width(),screen height()
delete bitmap 1
ink rgb(255,255,255),0
position camera 2500,15,2500
rem get the value of the default FOV in radians
rem this is ~62 degrees
fov#=3.14/2.905
return
_zoom:
rem left mouseclick to toggle zoom
omc=nmc
nmc=mouseclick() & 1
if nmc > omc
zoom=1-zoom
rem recalculate FOV to create zoom effect
if zoom=1
degrees=10
pi#=3.14
fov#=(pi#/180)*degrees
set camera fov fov#
else
rem set the value of the default FOV in radians
rem this is ~62 degrees 3.14/2.905
rem I'll use a variation with the conversion from degrees
rem to radians built in
fov#=(3.14/180)*62
set camera fov fov#
endif
endif
if zoom=1
for obj=1 to 25
if object in screen(obj)=1
x=object screen x(obj)
y=object screen y(obj)
text x-50,y-20,"Object Number "+str$(obj)
endif
next obj
paste image 1,0,0,1
endif
return
_move_camera:
move camera (upkey()-downkey())*5
yang#=wrapvalue(camera angle y()+mousemovex())
yrotate camera yang#
return
Enjoy your day.