Java tutorial
//package com.java2s; import java.util.Arrays; public class Main { public static void setViewPointMatrix(float matrix[], float x, float y, float z) { // The matrix is // -z, 0, x, 0 // 0, -z, y, 0 // 0, 0, 1, 0 // 0, 0, 1, -z Arrays.fill(matrix, 0, 16, 0); matrix[0] = matrix[5] = matrix[15] = -z; matrix[8] = x; matrix[9] = y; matrix[10] = matrix[11] = 1; } }