Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24a32c98 authored by Scott Main's avatar Scott Main Committed by Android Git Automerger
Browse files

am e0a85960: am 9a0087f2: Merge "docs: OpenGL Training sample code fixes" into jb-mr2-docs

* commit 'e0a85960':
  docs: OpenGL Training sample code fixes
parents efd288a2 e0a85960
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -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
<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
transformation matrix (a rotation matrix) and then combine it with your projection and
camera view tranformation matrices:</p>
camera view transformation matrices:</p>


<pre>
<pre>
private float[] mRotationMatrix = new float[16];
private float[] mRotationMatrix = new float[16];
@@ -56,7 +56,7 @@ public void onDrawFrame(GL10 gl) {
    // Create a rotation transformation for the triangle
    // Create a rotation transformation for the triangle
    long time = SystemClock.uptimeMillis() % 4000L;
    long time = SystemClock.uptimeMillis() % 4000L;
    float angle = 0.090f * ((int) time);
    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
    // Combine the rotation matrix with the projection and camera view
    Matrix.multiplyMM(mMVPMatrix, 0, mRotationMatrix, 0, mMVPMatrix, 0);
    Matrix.multiplyMM(mMVPMatrix, 0, mRotationMatrix, 0, mMVPMatrix, 0);