Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenGL: Can see through one wall but not the other
    primarykey
    data
    text
    <p>I do not know whether this is a depth buffer issue or another. I can see through one wall but not another:</p> <p><img src="https://i.stack.imgur.com/1N6bp.png" alt="Wall viewable"></p> <p>Now when I rotate so the second wall becomes more prominent:</p> <p><img src="https://i.stack.imgur.com/0wGDn.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/Fluev.png" alt="enter image description here"></p> <p>I have the depth buffer enabled in Interface Builder. My OGL enables look like this:</p> <pre><code>// enables glEnable(GL_BLEND); glEnable(GL_DEPTH_TEST); glEnable(GL_SMOOTH); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); //glEnable(GL_CULL_FACE); //glCullFace(GL_BACK); glFrontFace(GL_CCW); //glDepthMask(GL_TRUE); //glDepthFunc(GL_LESS); </code></pre> <p>Any suggestions. I commented out the other enables as they did not seem to help.</p> <p>As request, here is the projection and modelview setup:</p> <pre><code>// initialize all rotation matrices, translation matrix, and model view matrix to identity rotateX = GLKMatrix4Identity; rotateY = GLKMatrix4Identity; rotateZ = GLKMatrix4Identity; modelMat = GLKMatrix4Identity; zNear = 0.1; zFar = 1000.0; frustumScale = 1.0; //GLint maxbuffers; //glGetIntegerv(GL_MAX_DRAW_BUFFERS, &amp;maxbuffers); //NSLog(@"Max. number of buffers: %d", maxbuffers); // called? NSLog(@"awakeFromNib called..."); // set the aspect ratio here NSSize dim = [self frame].size; aspectRatio = dim.width/dim.height; // compute the projection matrix projMat = GLKMatrix4MakePerspective(frustumScale, aspectRatio, zNear, zFar); ... // compute the model matrix GLKMatrix4 tempLeft = GLKMatrix4Multiply(rotateX, rotateY); GLKMatrix4 tempRight = GLKMatrix4Multiply(rotateZ, translation); modelMat = GLKMatrix4Multiply(tempLeft, tempRight); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload