antimatter15 / splat

WebGL 3D Gaussian Splat Viewer

Home Page:https://antimatter15.com/splat/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

issue with resize

yelouafi opened this issue · comments

I tried to handle resizes but got some weird results

window.onresize = () => {

    canvas.width = innerWidth / downsample;
    
    canvas.height = innerHeight / downsample;
    
    projectionMatrix = getProjectionMatrix(
	    camera.fx / downsample,
	    camera.fy / downsample,
	    canvas.width,
	    canvas.height,
    );
    
    gl.uniformMatrix4fv(u_projection, false, projectionMatrix);
    
    gl.uniform2fv(u_viewport, new Float32Array([canvas.width, canvas.height]));
};

image