First commit

This commit is contained in:
2025-11-17 17:18:43 +01:00
parent 2286a3b782
commit bca5ef911b
905 changed files with 950521 additions and 2 deletions

39
engine/light.js Executable file
View File

@@ -0,0 +1,39 @@
/*
* Copyright 2013, kaj dijkstra ,
* Author, Kaj Dijkstra.
* All rights reserved.
*
*/
/**
* light
**/
kepler.light(){
this.position = [190.0,20.0,100.0];
this.target = [0,0,0];
this.up = [0,1,0];
this.projection;
this.view;
this.viewProjection;
this.far = 2420;
this.near = 0.1;
this.type = 'directional';
this.update();
}
/**
* update light
**/
kepler.light.prototype.update(){
var matrix4 = kepler.matrix4;
this.projection = matrix4.perspective(kepler.math.degToRad(45), kepler.width / kepler.height, this.near, this.far);
this.view = matrix4.lookAt(this.position, this.target, this.up);
this.viewProjection = matrix4.mul(this.view, this.projection)
}