3D 空间中的点旋转 [英] Rotation of Point in 3D Space

查看:23
本文介绍了3D 空间中的点旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个与 3D 空间中的点旋转有关的问题.

I have one problem related to rotation of point in 3D-space.

假设我有一个具有 X、Y 和 Z 坐标的点.

Suppose I have one point with X, Y and Z coordinates.

现在我想通过以下三种方式之一指定旋转来旋转它:

And now I want to rotate it, by specifying the rotation in one of these three ways:

  1. 按用户定义的度数
  2. 通过用户定义的旋转轴
  3. 围绕(相对于)用户定义的点

我在 这里找到了很好的链接,但它没有解决第 3 点.谁能帮我解决这个问题?

I found good link over here, but it doesn't address point 3. Can anyone help me solve that?

推荐答案

所有的旋转都会绕着原点.所以你翻译到原点,旋转,然后翻译回来.

All rotations will go around the origin. So you translate to the origin, rotate, then translate back.

T = translate from global coordinates to user-coordinates
R = rotate around the origin (like in your link)
(T^-1) = translate back
point X

X_rotated = (T^-1)*R*T*X 

如果要旋转多个点,则将矩阵相乘:

If you have multiple points to rotate then multiply the matrices together:

A = (T^-1)*R*T
X_rotated = A*X

这篇关于3D 空间中的点旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆