0
$\begingroup$

I am trying to set up a pitch yaw roll style rotation for a programming project. Currently, I'm rotating defining each axis of rotation as:

Yaw Axis   = (0,0,1)
Pitch Axis = (0,1,0)
Roll Axis  = (1,0,0)

My issue is that when the object 'rolls' it should then pitch in the axis relative to it's new rotation, however as I'm always defining the axis for pitch as (0,1,0) it always pitches up or down, regardless of orientation. How do I calculate the axis that is perpendicular to my objects new rotation?

Cheers! Kaine

$\endgroup$
  • $\begingroup$ roll your three axes at the same time when you are rolling the object $\endgroup$ – Brian Cheung Sep 6 '15 at 14:53
  • $\begingroup$ I managed to get it kind of working when trying that method, for example I had Pitch Axis = (0, cos(roll), sin(roll)) which works if you roll then pitch. However, if I pitch upwards, then roll, because the pitch axis is dependent on the roll, it not only rolls but it also rotates as the Pitch Axis is changing, I can't figure out the relationship between all three to make this work... any ideas? $\endgroup$ – Kaine van Gemert Sep 7 '15 at 11:02
  • $\begingroup$ I think that the pitch axis only depends on the 'old' roll axis, not on the 'new' roll axis. That is, each time when you want to do 'sth', you have to do 'Yaw = sth(Yaw); Pitch = sth(Pitch); Roll = sth(Roll); object = sth(object)' where '=' here means 'assigning value', not 'equal'. $\endgroup$ – Brian Cheung Sep 7 '15 at 11:23
  • $\begingroup$ Thanks for the reply! I'll certainly give this a go, just like to clarify.. what do you mean by sth? Cheers! $\endgroup$ – Kaine van Gemert Sep 7 '15 at 15:59
  • $\begingroup$ Sth means any single rotation action by any degree, for example "Yaw 30 degrees" or "Roll 90 degrees". Cheers! =D $\endgroup$ – Brian Cheung Sep 7 '15 at 16:06

Your Answer

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

Browse other questions tagged or ask your own question.