Forum Discussion
mfrancis107
9 years agoHonored Guest
OculusSDK OpenGL and Scale
I'm trying to understand how to determine how to relate OpenGL units to real life units. For example if I make a plane that is 10.0f x 10.0f in OpenGL it's not looking like 10 meters x 10 meters when in the Rift. Is there a method to calculate the appropriate ratio?
3 Replies
- Mars3DHonored GuestSomewhere in your code you should be setting a property called HmdSpaceToWorldScaleInMeters, setting that property to 1 should make 1 unit in OpenGL appear 1 meter in the Rift.
- jhericoAdventurer
"mfrancis107" wrote:
I'm trying to understand how to determine how to relate OpenGL units to real life units. For example if I make a plane that is 10.0f x 10.0f in OpenGL it's not looking like 10 meters x 10 meters when in the Rift. Is there a method to calculate the appropriate ratio?
Make sure you're using a consistent scale for your rendering:- Base camera matrix
- Individual eye camera matrix
- Near and far planes of the projection matrix
In particular, you need to make sure that the eye cameras are separated by the interpupillary distance (IPD). If they aren't then the motion parallax of the objects in the world won't match the binocular parallax and it can lead to VR sickness.
Make sure you're telling the Oculus SDK what your scale is in the HmdSpaceToWorldScaleInMeters member of the ovrViewScaleDesc structure that is passed to ovr_SubmitFrame.
If that's not working for you, you should post some example code for how you're setting up your matrices. - galopinHeroic ExplorerThere is absolutely no constraint on the units with GL or Direct X, all that matters is that the whole is consistant. It is also true for Y versus Z up, left or right handed...
The only difference notable gl versus direct x is the projected space cube on depth, GL visible space is -1..1 while DX is 0..1
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 7 months ago
- 9 months ago
- 6 months ago