private static boolean test(float[] v1, float[] v2, float[] transformationMatrix, float maxDiff) {
float[] resultVector = new float[4];
Matrix.multiplyMV(resultVector, 0, transformationMatrix, 0, new float[] { v1[0], v1[1], v1[2], 1 }, 0);
normalize(resultVector);
boolean theSame = true;
for (int i = 0; i < 3; i++) {
if (!almostTheSame(resultVector[i], v2[i], maxDiff)) {
theSame = false;
}
}
if (!theSame) {
System.out.println("Difference");
Vector.dump("Was", v1);
Vector.dump("Became", resultVector);
Vector.dump("Should be", v2);
return false;
}
return true;
}