how can I maintain a consistent scaling of a sphere regardless of the rotation of the model? For example, take the following (scaled) sphere:
In this image, we start with a sphere, looking at it directly through the Z-azis. The sphere is scaled by 0.7x on the Y (up/down) axis, giving it a 'squashed' appearance.
A 3D vector that describes the scaling of this sphere is [1.0, 0.7, 1.0]
. The red dot indicates an arbitrarily chosen point on the surface of the sphere that we will mark as the 'top'.
Now, after the sphere rotates 90 degrees through the Z-axis, the same scaling coefficients [1.0, 0.7, 1.0]
when applied will produce a result like this:
My question is as follows:
Given a rotation quaternion Q
that represents the rotation of the sphere, how can I use Q
to correctly alter the scaling coefficients vector in order to produce a result like this instead:
Notice that the eventual 'oriented shape' of the sphere is the same as in the first image, even though a 90-degree-through-Z rotation has been applied. In this instance, a corrected scaling coefficient vector would be something like [0.7, 1.0, 1.0].
I've tried simply multiplying the scaling coefficients vector by Q
but this gives an incorrect result. This is actually trivial to see if you imagine rotating [1.0, 1.0, 1.0] by 45 degrees through any angle. The answer should always remain as [1.0, 1.0, 1.0] but it does not.