-1
$\begingroup$

Im working with a quaternion, and its roll pitch and yaw are based on its global location(Im not actually sure how quaternions work, im guessing its on fixed axis). So when i get the values they are always fixed in a certain direction, the "0" of yaw is in some fixed direction. What i would like to do is kind of "reset" the rotation so that its "0" is pointing to the direction directly in front of me and that all rotations from that point will be based on the "0" being the direction i was initially facing. How do i do this?

Example:
     ^---say this is the original origin or "0" of the rotation.
  <     >
     v

Then if i am facing down:
     ^
  <     >
     v---I would then like this to be the new origin or rotation.
$\endgroup$
  • $\begingroup$ It sounds like you want to rotate with respect to the axes of some previously-rotated body. Is that the case? $\endgroup$ – Muphrid Dec 1 '15 at 4:12
  • $\begingroup$ I think that can be another way of putting it. So after rotating it the first time to get a new origin, it will rotate again with respect to the new origin based on the original quaternion. $\endgroup$ – Inspector Dec 1 '15 at 17:05
  • $\begingroup$ When you say origin that makes it sound like a translation is happening--that the central point of the object is moved. Is that what you mean? Or so you say origin and mean a set of axes? $\endgroup$ – Muphrid Dec 1 '15 at 17:09
  • $\begingroup$ sorry i meant it as the axes rotation. So if your facing one way initially that would be the origin "currently" and what i would like is if i turned around that would be the new origin(me facing backwards). But thanks for trying to help, i figured it out. It turns out i just had to invert the quaternion i wanted as the new origin. $\endgroup$ – Inspector Dec 1 '15 at 20:32
0
$\begingroup$

Turns out i just had to invert the quaternion i wanted as the new origin and multiply the current quaternion.

$\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.