OpenGL ES 2 - noob question regarding depth
okay i'm kind of new to this 3D math and it was a major milestone was to get the projection &开发者_开发百科; modelview matrices right last night :]
so i've got this simple model which renders correctly from this angle:
but when i rotate around the y axis, there's something wrong with the depth like this:
that might look interesting, but is not what i want currently. Basically the depth of these walls get mixed up?
can someone point me to the necessary steps on how to solve this? i need a depth buffer or something... right?
You should enable depth testing by calling
glEnable(GL_DEPTH_TEST);
And of course do not forget to clear your buffers by calling:
glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
I hope that this will help ;)
精彩评论