question

Jayson Powers avatar image
Jayson Powers asked

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?
fire tablet
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Sujoy@Amazon avatar image
Sujoy@Amazon answered
Hi Jayson, Thank you for the post. This issue is specific to your app. Please raise a ContactUs ( https://developer.amazon.com/help/contactus.html) with the complete code sample and one of our support engineer will help you on this.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Bipin@Amazon avatar image
Bipin@Amazon answered
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.
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.