msashape3d + ios : depth does not seem to work (?)

Hi all,

i’m trying to display a textured cube and make it rotate. I’m based on the topic : http://forum.openframeworks.cc/t/opengl-es-cube/4267/0

But that code doesn’t work! I tried a lot of things like :

  • setup USE_DEPTH_BUFFER with values 0, 0.1, 1, 24
  • put glEnable(GL_DEPTH_TEST)
  • glClear(GL_DEPTH_BUFFER_BIT) in “draw()” part
  • relocate the z location of the cube (far and close)
  • the texture do not seem to be the problem.

Please help me, i spent almost my whole day at work on this ???

Love openframeworks even it kills me.

Arno

Does this solve the problem – edit main.mm to call enableDepthBuffer();

  
  
int main(){  
	ofAppiPhoneWindow * window = new ofAppiPhoneWindow();  
	window->enableDepthBuffer();  
	window->enableAntiAliasing(4);    
	ofSetupOpenGL(window, 1024,768, OF_FULLSCREEN);			// <-------- setup the GL context  
      
	// this kicks off the running of my app  
	// can be OF_WINDOW or OF_FULLSCREEN  
	// pass in width and height too:  
	ofRunApp( new testApp());  
}  
  

Hi,

works great thx again!
I saw this code somewhere but i thought it was only for glut version (like OF Mac OSX for example). I guess i was wrong :slight_smile:

Thx,

Arnaud