private float[] matrixToArray(Matrix... matrices) { double[] temp = new double[16]; int counter = 0; float[] mvF = new float[matrices.length * 16]; for (Matrix m : matrices) { temp = m.toArray(temp, 0, false); for (int i = 0; i < temp.length; i++) { mvF[counter] = (float) temp[i]; counter++; } } return mvF; }
@Override protected void applyModelviewTransform(DrawContext dc, SurfaceTileDrawContext sdc) { // Apply the geographic to surface tile coordinate transform. Matrix modelview = sdc.getModelviewMatrix(); dc.getGL().glMultMatrixd(modelview.toArray(new double[16], 0, false), 0); }