Ich weiß nicht woran es liegt, vielleicht bin ich einfach nur zu blöd dafür, aber wenn ich ein Objekt um 90 Grad drehen will, wird es irgendwie “überdreht”:
Hier mal meine Rotationsmatrix-Methode und der Aufruf dieser Methode:
float[] rotationX = rotate(1, 0, 0, 90);
public static float[] rotate(float x, float y, float z, float angle) {
final float len = (float) Math.sqrt(x * x + y * y + z * z);
final float c = (float) Math.cos(Math.toDegrees(angle));
final float s = (float) Math.sin(Math.toDegrees(angle));
x = x / len;
y = y / len;
z = z / len;
final float[] m = new float[16];
m[0] = x * x * (1 - c) + c;
m[1] = y * x * (1 - c) + z * s;
m[2] = x * z * (1 - c) - y * s;
m[4] = x * y * (1 - c) - z * s;
m[5] = y * y * (1 - c) + c;
m[6] = y * z * (1 - c) + x * s;
m[8] = x * z * (1 - c) + y * s;
m[9] = y * z * (1 - c) - x * s;
m[10] = z * z * (1 - c) + c;
m[15] = 1;
return m;
}