Forum Discussion
hesham
13 years agoProtege
OpenGL Stereo Camera Setup and Convergence
Edit: I think that my baseline needs to change to get rid of the 0.5 up front, but everything else still broken: float const baselength = near_ * std::tan(M_PI * (fov_/2.0 / 180.0)); I've been stuc...
bluenote
12 years agoExplorer
"scottnykl" wrote:
I've noticed the SDK in 0.2.5c doesn't compute the perspective projection matrix according to the canonical OpenGL Perspective Projection Matrix. When integrating the Oculus into my OpenGL engine, I had to scale the perspective matrix element at [row 2, column 3] by a factor of 2.0.
I've actually written a blog article about this at http://nykl.net/?page_id=175 . Hopefully someone will find it useful. Perhaps others have a justification for why the perspective projection matrix leaves out many of the "correct" computations. I assume that the Oculus developers would believe far - near ~= 0; however, this is not always a good assumption when rendering vast distances (for flight simulators, for example). A more detailed explanation is given at my blog.
Good point, I was confused by this as well. However, I did change back and forth from a factor 1.0 (as in Oculus documentation) and factor 2.0 (as in the OpenGL documentation) and I can't really tell what is right or wrong :-/. To me, a factor of 2.0 just seems to increase the world scale, but I simply can't say what is the right scale... So far, I did not find the time to look into the maths to check what is the formal correct solution. Oh and btw, following your argumentation, matrix element M[2,2] is also "wrong", right? The Oculus documentation only contains zFar in the numerator, whereas OpenGL says (zFar-zNear). Did you change this matrix element accordingly? Ok, since zNear << zFar this should be almost negligible... An explanation from the Oculus devs on this would be great.
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
- 13 years ago