iPhone opengl es:绕点旋转矩阵
我正在 iPhone 上使用 opengl es 做一些工作,但我陷入了一个特定的点。互联网上的所有代码示例都向您展示了矩阵如何绕 x 轴、y 轴或 z 轴旋转,但没有人谈论矩阵如何绕任意点旋转?
我正在使用 open gl es 2.0。任何帮助将不胜感激。
问候,
I am doing some work with opengl es on the iPhone and I am stuck at a particular point. All the code samples on the internet show you how a matrix can be rotated about the x axis, y axis or the z axis but no one talks about how a matrix can be rotated about an arbitrary point?
I am using open gl es 2.0. Any help would be appreciated.
Regards,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您好像在问如何构建一个围绕其中一个轴但在不同点旋转的矩阵。执行此操作的方法是首先平移到该点,然后对所需的轴应用旋转。矩阵相乘的顺序取决于您将其视为移动轴还是几何图形。
如果您还希望能够同时进行任意x、y、z角度的旋转,您可以使用讨论的矩阵本文:
It sounds like you're asking how to construct a matrix that rotates around one of those axes, but at a different point. The way you do that is to first translate to that point, and then apply the rotation for the axis you want. The order of multiplication of matrixes depends on whether you think of it as the axes moving or the geometry.
If you also want to be able to do a rotation of arbitrary x, y, z angle at the same time, you can use the matrix discussed in this article: