Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
kevin0228ca's avatar
kevin0228ca
Explorer
9 years ago

How to properly set eye offset for stereo rendering in OpenGL

Hi,
I am trying to integrate Oculus Support to a 3D modeling software.
The software has its own Camera structure and rendering loop written in OpenGL.
I figured the solution for stereo rendering is to change the position of the camera by a difference of IPD when rendering for each eye?

My question is that the camera is located at some far distance OpenGL unit from the scene, e.g. at (0, 0, 5000).
Then I would try to set the camera offset distance using ovr_GetRenderDesc() to calculate HMDtoEyeOffset by ovr_CalcEyePoses().
And add HMDtoEyeOffset to the camera position for each eye rendering?
But the offset I calculated using the Oculus SDK is relatively minimal, since I think one Oculus unit is 1 meter so calculated offset is about 0.032 units for each eye because IPD is 64mm.
Is the assumption wrong that adding such a small offset to the camera located at (0,0,5000) viewing an object rendered at (0,0,0) would not matter enough to produce stereo effect? i.e. such a small offset is same as not moving camera at all.

Could anyone answer how I could convert the offset unit calculated by the Oculus SDK to scale to the units in a OpenGL program?
Thank you.

1 Reply

  • Anonymous's avatar
    Anonymous
    To get 3D effect the offset should be approx. 1/30 from the objects in zero paralax plane. And the most interesting object should be in this plane because the 3D effect is the best. So if you see something 1 m away, the parallax should be 3 cm. It is not "orthostereoscopy" giving exact distances, but It is an adaptive method how to see 3D thing with best stereo effects. Generally correct placing of 3D camera + scene arrangement is a bit science. But you can use as well the ortohostereoscopci approach = map eyes in exact work units. But you will never see in 3D ant legs and you will see flat mountains at the horizont ...