点在三维空间旋转 [英] Rotation of Point in 3D Space

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

问题描述

我有一个问题,涉及到的点在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. 在围绕(相对)用户自定义对焦点

我找到了很好的链接了<一href="http://www.siggraph.org/education/materials/HyperGraph/modeling/mod_tran/3drota.htm#X-Axis%20Rotation"相对=nofollow>此处,但它并没有解决问题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

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

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