antimatter15 / splat

WebGL 3D Gaussian Splat Viewer
https://antimatter15.com/splat/
MIT License
1.7k stars 169 forks source link

issue with resize #8

Closed yelouafi closed 9 months ago

yelouafi commented 9 months ago

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