i think i managed to figure this out.
i had the near clip distance on my camera set really low and that made all my math super jittery, i increased it and it's MASSIVELY better now.
so, only go further for your own amusement!
i think i managed to figure this out.
i had the near clip distance on my camera set really low and that made all my math super jittery, i increased it and it's MASSIVELY better now.
so, only go further for your own amusement!
This gives me two things I need to work out, how far "back" to move the camera to fit inside the rect.
And, how much to translate the camera to get it inside the box.
This gives me two things I need to work out, how far "back" to move the camera to fit inside the rect.
And, how much to translate the camera to get it inside the box.
I have a world space Rect on the Z plane, that is my target.
I have a view space Rect, that represents the part of the screen I need to fit into.
I have a world space Rect on the Z plane, that is my target.
I have a view space Rect, that represents the part of the screen I need to fit into.