3D Object won't show until device's orientation changes
I'm using OpenGL 1.1 and I have code that won't display a bouncing cube until the devices orientation changes, I believe that it needs some kind of refresh, but I've trie: gl.glFlush(); gl.glFinish(); gl.glClear(mask); but none of those are redrawing the screen like simply re-orienting the screen manually, is there something I need to be doing in the code or settings in the AndroidManifest.xml?
Hi Jayson, When you first launch the app, you can't be sure what the "current" matrix is. It might be a matrix full of zeroes, it might be the Identity Matrix, and the default might vary by Android version. Therefore, when you first launch your app, your call to gl.glFrustumf(...) is not producing the results you expect, since you have not initialized your current matrix. This makes it impossible to see your cube. To initialize your current matrix, call gl.glLoadIdentity(). This replaces the current matrix with the "Identity Matrix." The Identity Matrix is "1" for matrix calculations, so setting your current matrix to the identity matrix enables you to start "fresh" for calculations. You should always call glLoadIdentity() whenever you change matrix modes, so that your calculations don't use old/unexpected matrix data.