Here you can find the source of transpose3x3Matrix(float[][] m)
public static final float[][] transpose3x3Matrix(float[][] m)
//package com.java2s; /**/*from w w w . ja v a 2 s. c o m*/ * ProScene (version 1.1.0) * Copyright (c) 2010-2011 by National University of Colombia * @author Jean Pierre Charalambos * http://www.disi.unal.edu.co/grupos/remixlab/ * * This java package provides classes to ease the creation of interactive 3D * scenes in Processing. * * This source file is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 3 of the License, or (at your option) * any later version. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * A copy of the GNU General Public License is available on the World Wide Web * at <http://www.gnu.org/copyleft/gpl.html>. You can also obtain it by * writing to the Free Software Foundation, 51 Franklin Street, Suite 500 * Boston, MA 02110-1335, USA. */ public class Main { /** * Utility function that returns the transpose of the given 3X3 matrix. */ public static final float[][] transpose3x3Matrix(float[][] m) { float[][] matrix = new float[4][4]; for (int i = 0; i < 3; ++i) for (int j = 0; j < 3; ++j) matrix[i][j] = m[j][i]; return matrix; } }