- Home /
Modify focal distance/image plane withour change FOV
Hi everybody,
i've a question about focal distance and FOV. I know that in Unity is possible to set the FOV that simulate the same effect of changing the focal lenght of the camera.
But i need to do something different.
I need to be able to modify the focal distance without modifing the FOV, and therefore the frustum.
To be clear: with focal distance I mean the distance between the camera and the image plane.
The consequent question is: do you know where is the image plane in Unity? it matches with the near plane? with the far plane? is somewhere in the middle? or there isn't a image plane at all?
Thank you very much.
Matteo
Your question is confusing. I think you need to specify what you are trying to accomplish rather than the method you are trying to use to accomplish the task. The image plane will be at the camera position, but I don't think that is what you need to know. The near and far clip planes just specify the range in front of the camera where objects are seen.
I'll try to explain my goal: I'm a researcher and in my lab we developed an immersive stereoscopic reality system, using an open source rendering engine. This engine let us do all the stuff we need in order to make our system work at its best, but the quality is quite awful. So we decide to switch to more advanced engine, like unity. Our system rely on a specific 3D visualization technique we patented, and it must modify the frustum of each virtual stereoscopic camera.
For now I'm able to modify the frustum of each camera by modifing the projection matrix, but I need to set the position of the image plane, aka its distance from the camera, aka the focal length. I must not use the tipical trick of changing the focal length by changing the FOV, cause in our system i need to set this two parameters indipendently.
So, back to my first question:
There is any way to directly set the focal length?
In case of negative answer:
Do you know where is positioned in the world the image plane, aka its distance from the camera or from the near plane?
Based on your link, I believe the image plane is at the camera position, but don't take that as gospel. If you don't get an answer here, you might ask on the Unity Forums.
Answer by XinJinXiang · Apr 05, 2015 at 01:34 PM
Hello Matteo I have a sample problem with fov and focal length. From unity forum I can know focalLength = frustumHeight 0.5f / Mathf.Tan(fov 0.5f * Mathf.Rad2Deg) But I don`t know exactly what is frustumHeight in Unity. I know that it is distance between main camera and image plane but I don`t know where is the image plane in Unity. I think you have a same problem with me so if you have a clear solution that please notify me about it.
Kind Regards
In the future, if you insist on resurrecting threads to provide a non-answer, please post it as a comment. Thanks,
Hi XinJinXiang, I can't find myself in the equation you wrote right now... But I can tell you two thing: 1. In Unity image plane = near plane. All the points in the 3D world will be projected onto the near plane. 2. I solve all my problem using a beta version of Unity, with advanced functionality about 3D stereoscopic visualisation... But is more or less 4 month that I don't work anymore on this project, so I can't really help you...
Thanks for your reply. 1. In Unity image plane = near plane. All the points in the 3D world will be projected onto the near plane. Then focalLength = Distance($$anonymous$$ain Camera Position,Near Plane),right? How do you modify fx and fy in your camera matrix? I wanted know correct camera matrix values for using OpenCV library. Regards
Yes you are right, I actually did an experiment to prove it. This question haunted me for weeks!