Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualBrother Bob

Posted 26 November 2012 - 04:07 AM

Two points:
  • The near and far clip plane values, as specified by the glOrtho or glFrustum (or equivalent functions) are along the negative Z-axis. That means a clip plane value of 5 means that the clip plane is located at z=-5.
  • If you leave out the projection matrix, the default matrix is the identity matrix which is equivalent to glOrtho(-1, 1, -1, 1, 1, -1).

Pay attention to the default clip plane values; near=1 and far=-1. This means that the near clip plane is located at z=-1, and the far clip plane is located at z=1. This means that a quad at z=-0.2 is close to the near clip plane than a quad at z=0.2, and thus your red quad occludes your white quad.

#2Brother Bob

Posted 26 November 2012 - 04:06 AM

Two points:
  • The near and far clip plane values, as specified by the glOrtho or glFrustum (or equivalent functions) are along the negative Z-axis. That means a clip plane value of 5 means that the clip plane is located at z=-5.
  • If you leave out the projection matrix, the default matrix is the identity matrix which is equivalent to glOrtho(-1, 1, -1, 1, 1, -1).
Pay attention to the default clip plane values; near=1 and far=-1. This means that the near clip plane is located at z=-1, and the far clip plane is located at z=1. This means that a quad at z=-0.2 is close to the near clip plane than a quad at z=0.2, and thus your red quad occludes your white quad.

#1Brother Bob

Posted 26 November 2012 - 04:06 AM

Two points:
  • The near and far clip plane values, as specified by the glOrtho or glFrustum (or equivalent functions) are along the negative Z-axis. That means a clip plane value of 5 means that the clip plane is located at z=-5.
  • If you leave out the projection matrix, the default matrix is the identity matrix which is equivalent to glOrtho(-1, 1, -1, 1, 1, -1).
So, let's combine point 1 and 2. Pay attention to the default clip plane values; near=1 and far=-1. This means that the near clip plane is located at z=-1, and the far clip plane is located at z=1. This means that a quad at z=-0.2 is close to the near clip plane than a quad at z=0.2, and thus your red quad occludes your white quad.

PARTNERS