Added scaling operation in Matrix4f

This commit is contained in:
Antoine
2021-05-18 19:01:18 +02:00
parent 2aa23512be
commit 4abc87597d
6 changed files with 98 additions and 7 deletions

View File

@ -48,6 +48,15 @@ public class Matrix4f {
return result;
}
public static Matrix4f scale(Vector3f vector){
Matrix4f result= identity();
result.elements[0 + 0*4] = vector.x;
result.elements[1 + 1*4] = vector.y;
result.elements[2 + 2*4] = vector.z;
return result;
}
public static Matrix4f rotateX(float angle){
Matrix4f result = identity();
float r = (float) Math.toRadians(angle);