Orthographic camera, viewpoint, correct aspect ratio
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
@ -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){
|
||||
|
Reference in New Issue
Block a user