Game Development Community

Field of View Question?

by Alan Murphy · in Torque Game Engine · 07/01/2009 (6:27 am) · 5 replies

Hi Guys, quick and simple question, I have a variable that I want to control the camera's field of view for zooming in and out! In what file will I find the Field of View variable that I need to modify? I have found many references to the fov throughout my project but not sure which one to modify, im thinking that it is the setCameraFov(F32 fov) in the camera.cc file? If it is do I need to bring my controlling variable in to camera.cc or would I somehow call it from where I have the variable which is in gameConnectionMoves.cc?

Thank you and I appreciate any help!

#1
07/01/2009 (7:28 am)
Alan, how can you find variables and functions in source code files if you don't own a license to use that source code?
#2
07/01/2009 (7:32 am)
Hi Ted, I am a student doing a college project and I am using my supervisors license for the course of the project! The license is under this account! Can you help?
#3
07/01/2009 (7:38 am)
@Valerie: Okay... You should always post code questions under the account that has the license, otherwise you get mistaken for those kids who get Torque off a torrent and then think they can get support off the forums.

As for your question, I don't think you need to introduce another variable- just use setCameraFOV() to change the FOV to what you need. If you want a zoom effect, you can probably use schedule() with it to get that effect, unless you specifically want it done in code.
#4
07/01/2009 (7:48 am)
Oh ok, thank you will post off proper account in future! Where can I call this setCameraFov() from? You see it is head tracking I am doing and variables are constantly changing with the co-ordinates of my head position! I have all the rotation working controlling the pitch and yaw! Now, I just want the camera to zoom in when the z co-ordinate decreases and out when it increases! I have these variables in gameConnectionMoves.cc and when I try to call the setCameraFOV() in there, I get an error saying 'setCameraFov' identifier not found! Should I be calling it from somewhere else? Thanks for the help!
#5
03/18/2011 (12:16 am)


Hi everybody!! i have a question that concerns cameraFov and the Turret Class that i cant solve.

I am using the turret class on torque 3D beta 3, and the turret works fine.. the problem happens for me, when the player is mount on the turret, because it dont takes the "cameraDefaultFov" that i set (in this case "140.0"), i set this value on the player.cs that is located on the datablocks folder.. when the player is unmount it takes the cameraFov value that i set before on the player.cs.... so i dont know why is this happening? the cameraFov change when the player is mount on the turret again. Its supose to be the same camerafov when it is unmount and when it is mount on the turret... if i previously set the value on the player.cs, i dont know whats happening, i hope you could help me, Thanks in advance..

Regards