[Solved] ofxBox + bind texture not correct

I’m using the ofBoxExample on iOS to get a feel for binding a texture to a ofBox. However, it seems like some of the sides aren’t rendering correctly since you can see through them when the box should be solid. Has anyone noticed this before?

![](http://forum.openframeworks.cc/uploads/default/2320/photo 1.PNG)

![](http://forum.openframeworks.cc/uploads/default/2322/photo 2.PNG)

more picture examples.

the last picture is correct. So only certain angles it seems to render correctly.

![](http://forum.openframeworks.cc/uploads/default/2324/photo 3.PNG)

![](http://forum.openframeworks.cc/uploads/default/2326/photo 4.PNG)

Do you have depth test enabled?

I believe so. I have the following in my main.mm

  
    ofAppiPhoneWindow * iOSWindow = new ofAppiPhoneWindow();    
    iOSWindow->enableAntiAliasing(4);    
    iOSWindow->enableRetinaSupport();    
    iOSWindow->enableDepthBuffer();    
    ofSetupOpenGL(iOSWindow, 480, 320, OF_FULLSCREEN);  
	ofRunApp(new testApp);  

Is there another call other than ‘iOSWindow->enableDepthBuffer();’ we need to do?

Ah ok,

I missed that you need the following in main.mm:

  
iOSWindow->enableDepthBuffer();      

AND

  
glEnable( GL_DEPTH_TEST );   

before the 3D part.

Thanks for the tip!