Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.webgl = new G.Webgl();
this.time = 0
this.bgC = '#ffffff';
this.webgl.append();
this.webgl.clearColor(colors[0], 1)
this.mouse = {
x:0,
y:0,
}
this.camera = new G.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 500);
let s = 8;
this.cameraShadow = new G.PerspectiveCamera(45, 1, 0.1, 100);
// this.cameraShadow = new G.OrthographicCamera(-s,s,-s,s, 1, 50);
this.cameraShadow.lookAt([0,20,1], [0,0,0], [0,1,0]);
this.mvpDepth = mat4.create();
mat4.multiply(this.mvpDepth, this.cameraShadow.projection, this.cameraShadow.view)
const biaMatrix = mat4.fromValues(
0.5, 0.0, 0.0, 0.0,
0.0, 0.5, 0.0, 0.0,
0.0, 0.0, 0.5, 0.0,
0.5, 0.5, 0.5, 1.0
);
mat4.multiply(this.mvpDepth, biaMatrix, this.mvpDepth);
this.controls = new OrbitalCameraControl(this.camera, 20, window);
this.fbo = new G.FrameBuffer(gl, 1024, 1024 , { depth: true});
});
window.scene = this;
this.webgl = new G.Webgl();
this.time = 0
this.bgC = '#ffffff';
this.webgl.append();
this.webgl.clearColor(colors[0], 1)
this.mouse = {
x:0,
y:0,
}
this.camera = new G.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 500);
let s = 8;
this.cameraShadow = new G.PerspectiveCamera(45, 1, 0.1, 100);
// this.cameraShadow = new G.OrthographicCamera(-s,s,-s,s, 1, 50);
this.cameraShadow.lookAt([0,20,1], [0,0,0], [0,1,0]);
this.mvpDepth = mat4.create();
mat4.multiply(this.mvpDepth, this.cameraShadow.projection, this.cameraShadow.view)
const biaMatrix = mat4.fromValues(
0.5, 0.0, 0.0, 0.0,
0.0, 0.5, 0.0, 0.0,
0.0, 0.0, 0.5, 0.0,
0.5, 0.5, 0.5, 1.0
);
mat4.multiply(this.mvpDepth, biaMatrix, this.mvpDepth);
constructor()
{
this.webgl = new G.Webgl();
this.webgl.clearColor('#ffe1d9', 1);
this.webgl.append();
this.camera = new G.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 500);
this.controls = new OrbitalCameraControl(this.camera, 20, window);
this.controls.center = [4, 0, 0];
this.fboHelper = new G.FBOHelper(this.webgl, 256);
// this.cameraShadow = new G.PerspectiveCamera(45, 1, 0.1, 100);
const s = 15;
this.cameraShadow = new G.OrthographicCamera(-s, s, -s, s, 1, 100);
this.cameraShadow.lookAt([0, 50, 0.1], [0, 0, 0], [0, 1, 0]);
this.mvpDepth = mat4.create();
mat4.multiply(this.mvpDepth, this.cameraShadow.projection, this.cameraShadow.view);
const biaMatrix = mat4.fromValues(
0.5, 0.0, 0.0, 0.0,
0.0, 0.5, 0.0, 0.0,
0.0, 0.0, 0.5, 0.0,
0.5, 0.5, 0.5, 1.0
constructor()
{
this.webgl = new G.Webgl();
this.webgl.clearColor('#ffe1d9', 1);
this.webgl.append();
this.camera = new G.PerspectiveCamera(45, window.innerWidth / window.innerHeight, 0.1, 500);
this.controls = new OrbitalCameraControl(this.camera, 20, window);
this.fboHelper = new G.FBOHelper(this.webgl, 256);
this.scene = new G.Object3D();
const width = 2;
const height = 3;
const dataPos = new Float32Array(width * height * 4);
const pos = new Float32Array(width * height * 3);
const uvs = new Float32Array(width * height * 2);
const colors = new Float32Array(width * height * 3);
const size = new Float32Array(width * height * 1);
let count = 0;