d3alek / Texample2

Rendering Text in OpenGL ES 2 on Android
Other
83 stars 33 forks source link

(0, 0) position at top, left screen #7

Open ghost opened 7 years ago

ghost commented 7 years ago

currently, the (0, 0) position is at the center of the screen, but I want to set it at the top, left of the screen, how can I do it, try to change the matrix:

    for (int i = 0; i < 16; i++) {
        this.mtrxProjection[i] = 0.0f;
        this.mtrxView[i] = 0.0f;
        this.mtrxProjectionAndView[i] = 0.0f;
    }

    Matrix.orthoM(mtrxProjection, 0, 0f, width, height, 0f, 0.1f, 100f);
    Matrix.setLookAtM(mtrxView, 0, 0f, 0f, 1f, 0f, 0f, 0f, 0f, 1.0f, 0.0f);
    Matrix.multiplyMM(mtrxProjectionAndView, 0, mtrxProjection, 0, mtrxView, 0);

and the text can be displayed at 0, 0 but it has 180 angleDegX so I have to use this method:

    draw(string, x, y, 0, 180, 0, 0);

to rotate it again,

so how to set (0, 0) position at top, left of the screen without rotate the text?