4
\$\begingroup\$

I have an object in my game and I have its location, rotation and scaling in separate float[3]. The location rotation and scale are all on the global axis; these do not change based on the objects rotation. How would I convert them to the local axis where the xyz always corresponds to the same face?

\$\endgroup\$
  • \$\begingroup\$ Welcome to GameDev.SE! Take a look at the tour, and the help center if you have other questions about how this place works. Thank you for thanking us in advance, too, but I've edited that part out of your answer since comments in questions like that aren't necessary and can add clutter. :) \$\endgroup\$ – doppelgreener Oct 4 '13 at 3:50
3
\$\begingroup\$
  1. invert the object's transform
  2. apply that transformation to your world space rotation
  3. the result is your object space rotation
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.