从非倾斜仿射正交投影矩阵绕 Z 旋转
我似乎无法找到我认为应该是一个相当简单的问题的答案。
我正在尝试获取矩阵的 z 旋转,该矩阵表示始终朝向 Z 的正交投影的缩放、变换和旋转。只是围绕 Z 的旋转。
我意识到可能没有覆盖 100% 的解决方案用途(非仿射、倾斜等),但我只需要一个用于这种情况。
目的是让其他东西在简单的 CAD 查看器中工作(现在只需将这部分放在一起)。
I can't seem to find an answer to what I thought should be a fairly straightforward problem.
I'm trying to get the z-rotation of a matrix which represents the scale, transform and rotation of an orthogonal projection which always looks towards Z. Just the rotation around Z.
I realise that there may not be a solution that covers 100% of uses (non-affine, skew, etc), but I just need one for this case.
Purpose is to get something else working (just need to fudge this part together for now) in a simple CAD viewer.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
矩阵的第一行和第二行分别是侧面向量和向上向量,
因此假设向上向量垂直向上(没有 z 轴旋转),侧面向量指向右侧,您可以计算出角度是预期(即非滚动)矢量和您拥有的矢量之间的角度。这只是调用的结果
Well the first and second rows of the matrix are the side and up vectors (respectively)
So assuming that the up vector would point straight up (for no z-rotation) and the side vector would point to the right you can work out what the angle is between the expected (ie non rolled) vector and the vector you have. This is simply the result of calling