-
Rotate object in absolute axis, not its own
Hi,
I have been fighting with this seemingly simple problem: I want to rotate an object based on external data. The rotation should always happen in the same axes in relation to the viewer, that is, the x axis should create vertical rotation, y should do horizontal rotation and z should do “clock-like” rotation. The problem is, when you rotate an object, its axes change position, so if you rotate, say Z after having rotated around Y, Z rotation looks like Y rotation. Not sure if I’m explaining this right.
I thought I could solve this by orbiting a camera around my object, by parenting it to a null object placed in the center that performs the rotation. That way the Z axis is preserved, but X and Y still get mixed up.
Here’s a short video showing what I mean: https://youtu.be/WRmpviCpPAI
I think the mathematically correct way to solve this is using quaternions. But 1) I don’t know them well enough 2) It seems overkill to code a very long expression, with classes and things like that, just to solve this.
I’m probably not the first to face this problem, has anyone got experience with something like it?
Thanks!
Some contents or functionalities here are not available due to your cookie preferences!This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.