Function
GetCurrentFOV()
This function will return the FOV value of the current camera.
SYNTAX
Return Float=GetCurrentFOV()
`*******************************************************************************
`* Function GetCurrentFOV() *
`* Created: 06/22/2003 *
`* Updated: 10/11/2004 *
`* By: Dmitry K aka DMiTR0S dmitr0s@newmail.ru *
`*******************************************************************************
`*******************************************************************************
`* Free License Agreement. *
`* *
`* The user/developer agrees to include a visible credit to "Dmitry Kuschev" *
`* within your programs documentation and or web site. *
`* *
`* The user/developer agrees to NOT offer the this source code for Sale. *
`* *
`* Providing the user/Developer agrees in full to the previous Free *
`* License Agreement clauses, the user/developer may use this source *
`* code FREELY in all their products, commercial or otherwise. *
`* *
`*******************************************************************************
Randomize Timer()
`FOV#=RND(3600)/10.0
`Set Camera Fov FOV#
Backdrop On
Sync Rate 0
Sync On
Do
Text 10, 10, "Function GetCurrentFOV() by Dmitry Kuschev"
Text 10, 50, "FOV# = "+Str$(FOV#)
Text 10, 70, "GetCurrentFOV() = "+Str$(GetCurrentFOV())
Sync
Loop
Function GetCurrentFOV()
r=Make Matrix4(100)
r=Make Vector4(101)
Projection Matrix4 100
Set Vector4 101, 1.0, 0.0, 0.0, 0.0
Transform Vector4 101, 101, 100
GetFOVResult#=Atan(1.0/(X Vector4(101)*((Screen Width()*1.0)/(Screen Height()*1.0))))*2.0
If GetFOVResult# <= 0.0 Then Inc GetFOVResult#, 360.0
r=Delete Matrix4(100)
r=Delete Vector4(101)
EndFunction GetFOVResult#
Specs: P4 2.4GHz, DIMM 256 266Mhz, 60GB HD 7200rpm ATA-133, GeForce 4 MX440, CD-RW+DVD, WinXP