mr_hippo started following Scaling content to fit perfectly using PIXI Projection's 3d camera
mr_hippo posted a topic in Pixi.jsHi, I'm using the PIXI Projection's 3d camera on a site that occupies the entire window — the camera moves, the content is always centered and the aspect ratio can change. I'm trying to figure out how to modify the camera so it will update its scale3d so all the content within a defined rectangle in space will fit in the window as big and perfectly as possible. Right now I'm doing it the stupid way and checking my content on a couple different aspect ratios, figuring out the numbers by hand through trial/error, and just interpolating those numbers in the actual code. Mostly works, the problem with this method is that it's off on more extreme all screens and doesn't scale perfectly — esp odd aspect ratios. It's tough to explain... here is the site: https://mmm.hsiao.science — if you resize the window you'll see the content scaling to try to fit but not perfectly. I think I just need some pointers so I know where to start. Any tips will be most appreciated! Also thanks for PIXI — makes it so easy to build something visual for those who don't enjoy coding too much.