docs: OpenGL Training sample code fixes

Change-Id: Ifc757a2cb55781d5c42f9256cb698aa5a3a54bb8
(cherry picked from commit 6da22f88434543e8796e0151f4bb11d74c16e847)
This commit is contained in:
Joe Fernandez
2012-10-02 11:03:45 -07:00
committed by Scott Main
parent 218120e079
commit ab1f29d935

View File

@@ -47,7 +47,7 @@ to a shape with rotation.</p>
<p>Rotating a drawing object with OpenGL ES 2.0 is relatively simple. You create another
transformation matrix (a rotation matrix) and then combine it with your projection and
camera view tranformation matrices:</p>
camera view transformation matrices:</p>
<pre>
private float[] mRotationMatrix = new float[16];
@@ -56,7 +56,7 @@ public void onDrawFrame(GL10 gl) {
// Create a rotation transformation for the triangle
long time = SystemClock.uptimeMillis() % 4000L;
float angle = 0.090f * ((int) time);
Matrix.setRotateM(mRotationMatrix, 0, mAngle, 0, 0, -1.0f);
Matrix.setRotateM(mRotationMatrix, 0, angle, 0, 0, -1.0f);
// Combine the rotation matrix with the projection and camera view
Matrix.multiplyMM(mMVPMatrix, 0, mRotationMatrix, 0, mMVPMatrix, 0);
@@ -67,7 +67,7 @@ public void onDrawFrame(GL10 gl) {
</pre>
<p>If your triangle does not rotate after making these changes, make sure you have commented out the
{@link android.opengl.GLSurfaceView#RENDERMODE_WHEN_DIRTY GLSurfaceView.RENDERMODE_WHEN_DIRTY}
{@link android.opengl.GLSurfaceView#RENDERMODE_WHEN_DIRTY GLSurfaceView.RENDERMODE_WHEN_DIRTY}
setting, as described in the next section.</p>