I want to use user’s device camera as background and I want to keep the proportions of camera independent of scene dimension. As example if the scene is in portrait mode, I have to scale down a little bit the background, so the image to fit the scene bondaries, same if the scene is landscape.
I tried something here, I think I’m close
So you need to also account for the screen aspect in the computation:
I leave you the offset computation to also ensure it would always be centered.
Hi @sebavan this is exactly what I was looking for.
One small thing, it is possiblle if I want to center the image?
Yup you can play with uOffset and vOffset.
The goal is to find how much to move which should be half one minus the video width on canvas width or the same for the height i would guess
could come in handy eventually.