Problem where the angle given in the rotation function was not converted to a radian
This commit is contained in:
@ -51,8 +51,8 @@ public class Matrix4f {
|
||||
public static Matrix4f rotateX(float angle){
|
||||
Matrix4f result = identity();
|
||||
float r = (float) Math.toRadians(angle);
|
||||
float cos = (float) Math.cos(angle);
|
||||
float sin = (float) Math.sin(angle);
|
||||
float cos = (float) Math.cos(r);
|
||||
float sin = (float) Math.sin(r);
|
||||
|
||||
result.elements[1 + 1 * 4] = cos;
|
||||
result.elements[2 + 1 * 4] = -sin;
|
||||
@ -66,8 +66,8 @@ public class Matrix4f {
|
||||
public static Matrix4f rotateY(float angle){
|
||||
Matrix4f result = identity();
|
||||
float r = (float) Math.toRadians(angle);
|
||||
float cos = (float) Math.cos(angle);
|
||||
float sin = (float) Math.sin(angle);
|
||||
float cos = (float) Math.cos(r);
|
||||
float sin = (float) Math.sin(r);
|
||||
|
||||
result.elements[0 + 0 * 4] = cos;
|
||||
result.elements[2 + 0 * 4] = sin;
|
||||
@ -81,8 +81,8 @@ public class Matrix4f {
|
||||
public static Matrix4f rotateZ(float angle){
|
||||
Matrix4f result = identity();
|
||||
float r = (float) Math.toRadians(angle);
|
||||
float cos = (float) Math.cos(angle);
|
||||
float sin = (float) Math.sin(angle);
|
||||
float cos = (float) Math.cos(r);
|
||||
float sin = (float) Math.sin(r);
|
||||
|
||||
result.elements[0 + 0 * 4] = cos;
|
||||
result.elements[1 + 0 * 4] = -sin;
|
||||
|
Reference in New Issue
Block a user