mult Matrices - Android java.lang

Android examples for java.lang:Math

Description

mult Matrices

Demo Code


//package com.java2s;
import android.opengl.Matrix;

public class Main {
    public static void multMatrices(float[] produktMatrix,
            float[]... matrices) {
        float[] tmp = new float[16];
        Matrix.setIdentityM(tmp, 0);/*from  ww  w.j  a v  a 2  s .co m*/
        for (int i = matrices.length - 1; i >= 0; i--) {
            Matrix.multiplyMM(tmp, 0, matrices[i], 0, tmp, 0);
        }
        for (int i = 0; i < 16; i++) {
            produktMatrix[i] = tmp[i];
        }
    }
}

Related Tutorials