06-25-2014 03:21 PM
06-25-2014 04:21 PM
"jherico" wrote:
I'm trying to work on a couple of examples showing the use of the orthographic projection matrix to render elements to the screen.
"jherico" wrote:
At first I had issues with not seeing anything at all, until I realized my geometry was there, but being eliminated by face-culling.
"jherico" wrote:
When I turned off face-culling I discovered that my simple quad had been flipped 180 degrees on the X axis, so that the white corner was in the lower left.
eachEye[eyeId].UVScaleOffset[0].y = -eachEye[eyeId].UVScaleOffset[0].y;
eachEye[eyeId].UVScaleOffset[1].y = 1.0f - eachEye[eyeId].UVScaleOffset[1].y;
06-25-2014 04:38 PM
"vrdaveb" wrote:"jherico" wrote:
I'm trying to work on a couple of examples showing the use of the orthographic projection matrix to render elements to the screen.
Sure, it also makes sense for a number of cases. If you render the same thing to both eyes, it will appear on a plane that is infinitely far away.
"vrdaveb" wrote:"jherico" wrote:
At first I had issues with not seeing anything at all, until I realized my geometry was there, but being eliminated by face-culling.
I assume you're using SDK 0.3.2. If so, we shouldn't be interfering with your culling state. If you're using GL_BACK and drawing the quad in counter-clockwise order our projection matrix shouldn't be causing the quad to get culled. Let me know if we are missing something there.
"vrdaveb" wrote:"jherico" wrote:
When I turned off face-culling I discovered that my simple quad had been flipped 180 degrees on the X axis, so that the white corner was in the lower left.
Can you try adding the following code to OVR::CAPI::GL::DistortionRenderer::SubmitEye(..), just after the call to ovrHmd_GetRenderScaleAndOffset(..)?eachEye[eyeId].UVScaleOffset[0].y = -eachEye[eyeId].UVScaleOffset[0].y;
eachEye[eyeId].UVScaleOffset[1].y = 1.0f - eachEye[eyeId].UVScaleOffset[1].y;
06-25-2014 05:28 PM
ortho.M[1][1] = -projection.M[1][1] * orthoScale.y; // Note sign flip (text rendering uses Y=down).
06-25-2014 06:45 PM
"vrdaveb" wrote:
It looks like the ovrMatrix4f_OrthoSubProjection(..) uses Y=down, resulting in a left-handed coordinate system that flipped the winding of your quad. I'll see about adding a "right-handed" option. For now, can you render your quad clockwise and upside-down? Alternatively you could flip the sign of the following line:ortho.M[1][1] = -projection.M[1][1] * orthoScale.y; // Note sign flip (text rendering uses Y=down).
pr.top()[1][1] = -pr.top()[1][1];
Did this answer your question? If it didn’t, use our search to find other topics or create your own and other members of the community will help out.
If you need an agent to help with your Meta device, please contact our store support team here.
Having trouble with a Facebook or Instagram account? The best place to go for help with those accounts is the Facebook Help Center or the Instagram Help Center. This community can't help with those accounts.
Check out some popular posts here:
Getting Help from the Meta Quest Community
Tips and Tricks: Charging your Meta Quest Headset