Example usage for android.opengl Matrix invertM

List of usage examples for android.opengl Matrix invertM

Introduction

In this page you can find the example usage for android.opengl Matrix invertM.

Prototype

public static boolean invertM(float[] mInv, int mInvOffset, float[] m, int mOffset) 

Source Link

Document

Inverts a 4 x 4 matrix.

Usage

From source file:Main.java

public static float[] inverseMatrix(float[] m1) {
    float[] m2 = new float[16];
    float[] m1i = new float[16];
    Matrix.transposeM(m1i, 0, m1, 0);/*from   w  w w. ja v  a  2  s .  c o m*/

    Matrix.invertM(m2, 0, m1i, 0);

    float[] m2i = new float[16];
    Matrix.transposeM(m2i, 0, m2, 0);
    return m2i;
}

From source file:Main.java

public static boolean invertM(float[] output, float[] input) {
    if (input == output) {
        return false;
    }/*from   w  w w.j a v a 2s.c o m*/

    return Matrix.invertM(output, 0, input, 0);
}