Orthographic camera, viewpoint, correct aspect ratio

This commit is contained in:
Antoine
2021-05-19 17:59:05 +02:00
parent 57b6be084d
commit e9935403b6
7 changed files with 47 additions and 14 deletions

View File

@ -15,6 +15,9 @@ public class ObjectGl {
protected Shader shader;
protected Matrix4f transform;
public static Matrix4f projection;
public static Matrix4f view;
public ObjectGl(){
}
@ -51,7 +54,11 @@ public class ObjectGl {
public void render(){
this.shader.enable();
this.shader.setUniformMat4f("projection", projection);
this.shader.setUniformMat4f("view", view);
this.shader.setUniformMat4f("transform", this.transform);
this.vertexArray.render();
this.shader.disable();
}

View File

@ -35,6 +35,8 @@ public class ObjectGlTex extends ObjectGl{
public void render() {
this.shader.enable();
this.shader.setUniformMat4f("projection", projection);
this.shader.setUniformMat4f("view", view);
this.shader.setUniformMat4f("transform", this.transform);
for (Texture t : textures){