Babylon.js icon indicating copy to clipboard operation
Babylon.js copied to clipboard

Screenshot | Ortho camera Auto-Scaling on screenshot using render targets

Open KevinBLT opened this issue 5 years ago • 5 comments

I jumped into a small inconvenience.

I have to created measured views and make pictures, but the images were distorted.

When creating a screenshot using render targets and active ortho camera the resulting image is distorted when the render size <> actual canvas size.

Look attached playground.

  • I suggest to set the ortho camera to the aspect of the screenshot before doing it, afterwards apply the previous one.

  • I also suggest a convenience method fo toOrtho() and toPerspective function, that will set it (like I do it this function here)

If you want you can assign this ticket to me, I will take a look, if I can integrate it in the core.

Playground with fix: https://playground.babylonjs.com/#UKNERM#278

(will need Pop ups to not being blocked, see description and commented line)

KevinBLT avatar Dec 14 '20 12:12 KevinBLT

Hey. That sounds to me. Do you want to send a PR?

deltakosh avatar Dec 14 '20 17:12 deltakosh

Yes. I just don't have time line here. I will do it in some free time the coming days and do it together with the other issue (with the shadow generator).

KevinBLT avatar Dec 14 '20 17:12 KevinBLT

Hi @KevinBLT - Do still want to do it? Thanks

thomlucc avatar Apr 12 '22 18:04 thomlucc

Hi @thomlucc, yeah I have a lot of internal changes to some aspects of Babylon.

Sorry I haven't been pushing them. I hope there will be time over easter-weekend, so thanks for reminding!

Did you hit this situation as well?

KevinBLT avatar Apr 13 '22 09:04 KevinBLT

oh yes! It's great you are still interested in submitting a PR. Thanks a lot.

thomlucc avatar Apr 13 '22 15:04 thomlucc

Closing due to inactivity. @KevinBLT - feel free to re-open when you have time to work on it. Thanks a lot!

thomlucc avatar Oct 27 '22 21:10 thomlucc