[SOLVED] How to resize window correctly when using OrthographicCamera

I’m using OrthographicCamera and I try to update the camera when browser window is resized. But after changing camra parameters, the cube scales incorrectly.



Demo is here and any help would be great appreciated :slight_smile:

It works fine, you just forgot to change

    camera.left = size * aspect / -2;
    camera.right = size * aspect / 2;


    camera.left = size * newAspect / -2;
    camera.right = size * newAspect / 2;

Thank you for pointing out my mistake. Now it works as expected:)

1 Like

Np! Welcome! Please hit the “Solution” button to mark it solved, and/or put [SOLVED] in the title to help others.