From Wikipedia, I've seen that if I have a rotation to do in three dimensions, it must be around an axis in order to do so. However, I have a rotation along the z-axis along with the xy-plane (aka a horizontal and vertical tilt respectively). How might I condense the calculation into one matrix?
Asked
Active
Viewed 457 times
1 Answers
0
A rotation with angle $\theta$ around the origin in the $(O,x,y)$ plane has matrix: $$\begin{bmatrix}\cos\theta& -\sin\theta\\\sin\theta &\cos\theta \end{bmatrix}$$ hence the matrix of a rotation of angle $\theta$ around the $z$ axis in $3$-space has matrix: $$\begin{bmatrix}\cos\theta& -\sin\theta &0 \\\sin\theta &\cos\theta& 0 \\ 0&0&1\end{bmatrix}$$
Bernard
- 175,478
-
If you read more carefully, I have TWO rotations to complete. The second one is not around an axis and as such the matrix above doesn't work. – Apr 01 '15 at 23:35
-
Then I don't understand the situation. You seemed to be looking for the matrix of a rotation around the $z$ axis. The second rotation is around what? – Bernard Apr 01 '15 at 23:40
-
I think if I expand on the situation it'll be more clear. So, I'm making a graphics renderer, which will have vertical and horizontal tilt. Moving the mouse up will add to the vertical tilt and so on for the other directions. Horizontal tilt is around the z axis, but vertical tilt is not around the x or y axis. Rather, it is around an axis that lies on the xy plane. The horizontal tilt makes it such that the point can be roughly rotated around the x axis, but this will lead to some incorrect vertical shift. – Apr 02 '15 at 00:09
-
Wow, okay. I just did the whole thing out without a matrix and it turns out that after the first rotation, the second one is still around the x-axis. Never mind lol. – Apr 02 '15 at 01:15