Jump to content
  • Advertisement
Sign in to follow this  

Rotate a line with two Quaternions (yaw / pitch)

This topic is 996 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:




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.




Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!