Java tutorial
//package com.java2s; /** * Copyright (C) 2012-2014 GREE, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ import android.graphics.Matrix; public class Main { public static void getMatrix3DValues(final Matrix matrix2D, final float[] matrix3D) { matrix2D.getValues(matrix3D); // Log.e("long", matrix2D.toShortString()); final float v0 = matrix3D[0]; final float v1 = matrix3D[1]; final float v2 = matrix3D[2]; final float v3 = matrix3D[3]; final float v4 = matrix3D[4]; final float v5 = matrix3D[5]; final float v6 = matrix3D[6]; final float v7 = matrix3D[7]; final float v8 = matrix3D[8]; matrix3D[0] = v0; matrix3D[4] = v1; matrix3D[8] = v2; matrix3D[1] = v3; matrix3D[5] = v4; matrix3D[9] = v5; matrix3D[2] = v6; matrix3D[6] = v7; matrix3D[10] = v8; matrix3D[3] = matrix3D[7] = matrix3D[11] = 0; matrix3D[12] = matrix3D[13] = matrix3D[14] = 0; matrix3D[15] = 1; } }