The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
What should be the dimensions of a plane to fit in user's FOV
As a starting screen of my app, I want to show a rectangular plane at the clipping plane's near value (0.85 meters). I will be instructing the user to adjust their hololens till all the corners of the plane are visible (somewhat like the "Learn Gestures" app in hololens). How should I be calculating the dimensions of this plane? I understand that the dimensions will depend on the distance of the object from the Main Camera. Any pointers for a "formula" that I can use to calculate these dimensions?
Best Answers
-
Optionsstepan_stulov ✭✭✭
Hi, @siddhantjain.
You don't need to ask the user to adjust anything for the purposes of your plane covering the near clipping plane. You have all the runtime data for this already.
When running on HoloLens, you camera's fov is driven by the device. You should treat it as read-only. Fov is actually the span angle (in degrees) of the vertical slice of the frustum.
From there you can easily determine half of the vertical size of the frustum by simply multiplying the distance from camera (you can for instance take near clip plane + 1% or + 1cm) by tan() of half of the fov.
Once you have vertical size, you can calculate the horizontal by multiplying the vertical by Camera.aspect.
Now simply apply the size to the plane, put it on the camera's forward vector (not forgetting the 1% or 1cm) and make it face the camera. Alternative simply make the plane child of the camera and only apply the size.
Hope this helps.
Building the future of holographic navigation. We're hiring.
5 -
Optionsthebanjomatic ✭✭✭
@siddhantjain There is a pull request on the HoloToolkit for exactly this kind of calibration screen:
https://github.com/Microsoft/HoloToolkit-Unity/pull/547
Its has not yet been committed (waiting on comments from one of the project owners), but you can sync down the change locally to see how that was setup.
5
Answers
Hi, @siddhantjain.
You don't need to ask the user to adjust anything for the purposes of your plane covering the near clipping plane. You have all the runtime data for this already.
When running on HoloLens, you camera's fov is driven by the device. You should treat it as read-only. Fov is actually the span angle (in degrees) of the vertical slice of the frustum.
From there you can easily determine half of the vertical size of the frustum by simply multiplying the distance from camera (you can for instance take near clip plane + 1% or + 1cm) by tan() of half of the fov.
Once you have vertical size, you can calculate the horizontal by multiplying the vertical by Camera.aspect.
Now simply apply the size to the plane, put it on the camera's forward vector (not forgetting the 1% or 1cm) and make it face the camera. Alternative simply make the plane child of the camera and only apply the size.
Hope this helps.
Building the future of holographic navigation. We're hiring.
@siddhantjain There is a pull request on the HoloToolkit for exactly this kind of calibration screen:
https://github.com/Microsoft/HoloToolkit-Unity/pull/547
Its has not yet been committed (waiting on comments from one of the project owners), but you can sync down the change locally to see how that was setup.