I have thousands of 3D models, primarily floorplans, that I need to display fully fitted within a React Three.js (@react-three/fiber
) canvas. I attempted to implement functions to center and calculate the appropriate zoom dynamically, but they didn’t work as expected.
As a workaround, I applied conditional zoomFactor
values based on the model dimensions, using hardcoded values to achieve the best fit.
Is this an effective approach, or is there a better way to dynamically fit and center each floorplan within the canvas? If so, how can I properly manage this?