Static viewport size

Hello, im trying to make vieport size static and cant find any info on how to do that. The problem is when i resize the window my wieport changing it size (see screenshots). Can anyone help? Here is my playground

image

Hello! You can recalculate the desired percentage of your viewport based on your current canvas size :smiley: Static camera viewport | Babylon.js Playground (babylonjs.com)

1 Like

You can also use engine.onResizeObservable to avoid calculating the canvas size every frame.

Static camera viewport | Babylon.js Playground (babylonjs.com)

1 Like

@bghgary @carolhmj Thank you for help! :+1:

image

2 Likes