This commit is contained in:
Kbz-8
2024-02-14 20:22:07 +01:00
parent 0bd7e05c17
commit f7fbfcad15
5 changed files with 192 additions and 18 deletions

View File

@ -17,8 +17,8 @@ export default class extends AbstractView
this.gl = null;
this.shader_prog = null;
this.buffers = null;
this.cam_pos = [0, 100, 0];
this.cam_target = [4, 0, 4];
this.cam_pos = [0, 500, 0];
this.cam_target = [0, 0, 35];
}
initGL()
@ -71,7 +71,7 @@ export default class extends AbstractView
const projectionMatrix = mat4.create();
const viewMatrix = mat4.create();
mat4.perspective(projectionMatrix, (90 * Math.PI) / 180, this.gl.canvas.clientWidth / this.gl.canvas.clientHeight, 0.1, 1000.0);
mat4.perspective(projectionMatrix, (90 * Math.PI) / 180, this.gl.canvas.clientWidth / this.gl.canvas.clientHeight, 0.1, 10000000.0);
mat4.lookAt(viewMatrix, this.cam_pos, this.cam_target, [0, 1, 0]);
this.setPositionAttribute();
@ -82,7 +82,7 @@ export default class extends AbstractView
this.gl.uniformMatrix4fv(shaderInfos.uniformLocations.projectionMatrix, false, projectionMatrix);
this.gl.uniformMatrix4fv(shaderInfos.uniformLocations.viewMatrix, false, viewMatrix);
this.game.draw(this.gl);
this.game.render(this.gl);
}
setNormalAttribute()