Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to see movement, you should update mTriangle.mAngle each frame (preferably as a function of time to combat speed differences or delays caused by other processes...).</p> <p>Note that Matrix.setIdentityM(mModelMatrix, 0); restores all the accumulated rotations and translations to "zero" or actually to Identity Matrix... The same convention applies btw to all <em>set</em> functions. To accumulate all the transformations, one has to</p> <ul> <li>setIdentity(model);</li> <li>translate(trans); // to get the origin of rotation</li> <li>rotate(rotmatrix); // to accumulate the rotation</li> <li>translate(t2); // to translate again to some better position...</li> </ul> <p>Also one should keep the values of object translation vector [ox,oy,oz] between each call and feed them to Matrix.translateM(mModelMatrix, ox, oy, oz, 0);</p> <p>Typically one concatenates all 'translate, rotate, scale', etc. matrices as early as possible and cache them per object, or hierarchically per a complex container having multiple objects and having a bounding box, so that multiple objects can be culled when on behind the camera (or generally outside the viewing frustum).</p> <p>Also typically one keeps a moving camera in one matrix and per frame multiplies it with the projection matrix.</p> <p>You can start with something like:</p> <pre><code>float Time = System.currentTimeMillis() * 0.01f; // 10 radians / second == fast! Matrix.translateM(mModelMatrix, Math.sin(Time)*2.0f, 0, 1f, 0); ... </code></pre> <p>As Tim noticed, there is no projection matrix involved, meaning that all z-values behave in this code exactly, even though changing x &amp; y values would make a difference. </p> <p>I'd be tempted to say, that MVP matrix would mean multiplying in order M * V * P = (M*V) * P = M * (V*P).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload