简体   繁体   English

Python 3D旋转点

[英]Python 3D rotation of a point

I have a point (x,y,z) in 3d that I would like to rotate. 我想在3d中旋转一个点(x,y,z)。 First I would like to rotate the point around another point (0,0,0) 360 degrees. 首先,我想将点绕另一个点(0,0,0)旋转360度。 Then I would like to change the plane that the point rotates in by 1 degree and repeat. 然后,我想改变点旋转1度的平面并重复。 I have been looking at the rotation_matrix function in http://www.lfd.uci.edu/~gohlke/code/transformations.py.html , however it seems as if the rotation only goes around the x,y or z axis rather than an arbitrary angle. 我一直在看http://www.lfd.uci.edu/~gohlke/code/transformations.py.html中的rotation_matrix函数,但是似乎旋转只绕x,y或z轴旋转,而不是比任意角度 Does anyone know how to accomplish this? 有谁知道如何做到这一点?

Rotating around the x, y, and z pretty much is the only way to do it. 唯一地绕x,y和z旋转是唯一的方法。 Rotating a plane is exactly like rotating around an axis. 旋转平面就像绕轴旋转一样。 Check out my scratch project for the math. 查看我的草稿项目以了解数学。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM