How to rotate object around local axis?

edited December 2013 in How To...

let's say I import a model of a plane. I need to rotate each axis independently like in 3D software where you have option to select to rotate model around local coordinate instead of world coordinate. How do I achieve that in processing?

Tagged:

Answers

  • They'll be other methods, but the most straightforward is to draw the object at (0, 0) or (0, 0, 0), rotate it and then translate it to where you want it.

  • Answer ✓

    Doing this without gridlock is difficult using Processing rotations from what I remember a while back. You would have to write functions that determine the order of rotations to do. Otherwise you could maybe find code for quaternion or matrix rotations.

  • ok i found a solution, using quaternion to repesent orientation. Then multiply that with new quaternion to create a new orientation.

    http://toxiclibs.org/docs/core/toxi/geom/Quaternion.html

Sign In or Register to comment.