With the release of viewports, I’ve been concerting my items into 3d rotating ones in the stats menu. But one thing I’ve been struggling with is keeping the object within the viewport Gui as they all vary in size. Firstly I CFrame the model into where the camera is for the viewport, and then find out which side is the biggest (X, Y, Z) and move it back depending on this offset. But this isn’t too effective, some models end up being tiny, whilst some are still clipping.
What is the fancy maths behind this?