cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement correct aspect ratio camera passthrough in Oculus

kevin0228ca
Explorer
Hi, I am trying to implement camera passthrough, I need passthrough to be as close to our natural eye as possible.
I know I need webcams that have about same FOV as Oculus, ~100 degree.
And the webcams should be as close to human eye as possible.

What confuses me is at how far in the VR world should the captured webcam be rendered?
If I render too far, passthrough is just a small rectangle, if too close, entire FOV cannot be seen.
So how to determine the right distance to render to match FOV of webcam and Oculus, so that passthrough shows as naturally as possible to a natural eye?
Is doing a calibration the only solution?
Can anyone point to how might a calibration be?
Thank you.
2 REPLIES 2

galopin
Heroic Explorer
Calibration ? no, you do not need that, all you need is middle school math :smiley:

Pythagorus and his triangle rectangle to be precise.

The oculus runtime give you the headset fovs for each eye. If you draw your frustum from above, it is two symetrical triangles spit by the camera direction.

Width divide by depth equa tan fov angle ^^

Now all you have to do is a rules of 3, pick a depth, and you get the quad width.

Do the same with the side view and you are done, oculus even have a quad layer lock on the view !

In practice, the math are a little more subtle because the Fovs are not symetrical, but you get the idea

kevin0228ca
Explorer
thanks I tried setting horizontal width of quad by calculating from rendering depth and FOV, then calculate height from aspect ratio of camera.
I tried with a 78 DFOV webcam and seems to work well.