• Advertisement
Sign in to follow this  

Rotate a line with two Quaternions (yaw / pitch)

This topic is 762 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi people,

 

I currently can't wrap my brain around this problem:

 

[attachment=31181:yawpitch.jpg]

 

X = Red

Y = Green

Z = Blue

 

I can calculate the Quaternion for the brown line simply with

yaw = 45;
y_axis = new Vector3(0, 1, 0);
Quaternion around_y_axis = Quaternion.fromAxisAngle(y_axis, yaw);

Based on left/right-mouseinput which adds to "yaw" I can simply rotate the line on the Red/Blue plane, but how can the line be moved up/down based on the top-bottom-mouseinput (pitch)?

 

The yaw axis is pretty simple, since it's just rotating around (0,1,0), but the pitch axis depends on the around_x_axis-Quaternion now?

 

I hope somebody can make some sense out of this and can help out with the math. When anything is unclear, please just ask and I will try to explain it better.

 

Regards,

treeRunner

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement