Correct camera:

l'espace de jeu est compris entre les coordonnées -1000:1000 et -1000*aspectRatio:1000*aspectRatio
Peut-être fixé l'aspect ratio du jeu pour ne pas avoir certains problèmes
This commit is contained in:
Antoine 2021-05-28 13:37:03 +02:00
parent 9612db9b49
commit 68580ce40b

View File

@ -38,7 +38,7 @@ public class Engine {
this.objectsGl = new ArrayList<>(); this.objectsGl = new ArrayList<>();
this.width = width; this.width = width;
this.height = height; this.height = height;
ObjectGl.projection = Matrix4f.orthographic(-width, width, -width * aspectRatio, width * aspectRatio, 0.1f, 100.0f); ObjectGl.projection = Matrix4f.orthographic(-1000, 1000, -1000 * aspectRatio, 1000 * aspectRatio, 0.1f, 100.0f);
ObjectGl.view = Matrix4f.translate(new Vector3f(0.0f,0.0f,1.0f)); ObjectGl.view = Matrix4f.translate(new Vector3f(0.0f,0.0f,1.0f));
} }