I have a plane mesh with position px,py,pz, rotation rx,ry,rz and some fixed height and width. My camera is initially at 0,0,0 and with rotation 0,0,0. When I click the plane mesh, I would like to position the camera such that:
the camera is parallel to the plane
the entire plane mesh is in view
How could I achieve this using Three.js? I am using a PerspectiveCamera. I am thinking of trying to calculate based on the camera's FOV and the height/width of the plane, but am a bit stuck