I’m having a hard time with an issue I’m trying to solve with threejs, and I hope anyone can point me in the right directions. I’m no 3D expert so maybe it’s just a simple thing.
I’m using the latest threejs version, together with the TransformControls.js component (from the examples), and I’m trying to apply the correct scale to an object after it has been rotated.
To be more specific on the problem, I’m trying to do a “scale to max” of an object on top of a platform with a predefined size of X, Y and Z, so that the object scales to the maximum possible size without being out of bounds of the platform. Doing that without the object being rotated is pretty easy. The problem is if the object was already rotated previously I can’t figure out how to apply the correct scale, because the object axis stay the same even after the rotation. Basically I would like to rotate the object but maintain the axis always fixed in relation to the platform and not the object itself…
thanks in advance