I have a plane that can get its scale changed during the game, and I want to make the camera view it completely every time the plane has its scale changed. The only camera is set to perspective projection.
I found this page which tells me how to resize the plane (I do not understand the unity of measure used there) to be viewed by the camera, and I want the reverse.
I found something similar here.
I also found other not-very-relevant answers by googling "unity camera fits a plane", "unity move camera to show an object" (one of the results is this), "unity field of view to fit an object" (one of the results is this).
I think I found the answer here, but it is hard for me to do the maths right now. I also found an answer here but I wish that someone explained me the mathematics (also, I do not know how to get the bounds
).
My relevant previous question with the same situation is here. There is a link to download a sample project, and a few screenshots.
Thank you.
y
,height
camera should be matched)? I understand that math can be a bit different in your version because you might not need it to be movable, rotatable... It would still probably match main logic though. I am trying to find reasons why this is not a duplicate question. \$\endgroup\$