从一系列不同点找到平均旋转
我叫斯坦利,我需要帮助:)。 我试图从一系列位置找到平均旋转。 (在这里和我在一起)。如果您对我的意思感到困惑,就像我自己一样,这就是一个例子。我正在制作划船游戏,并且有射线播出的命中率可以在船的每个角落找到四分。为了使浮动看起来逼真,我做到了,以便所有四个点的平均Y位置将是船的Y位置。但是我似乎无法弄清楚的平均轮换。
如果有0,0,0
和1,1,0
和0,1,1
的点,我已经进行了一些测试。使用XYZ坐标的平均旋转为-25,-25,50
,我似乎无法找出其背后的数学。 (我注视着统一的最后轮换,看上去很漂亮,这就是我得到这个数字的方式。)如果有人在网上看到任何有关此内容的东西,例如方程式或解决这个问题的方式,那将是一个巨大的帮助。
谢谢大家
Stan。
My name is Stanley and I need help :).
I am attempting to find the average rotation from an array of positions. (Stay with me here). If you are confused with what I mean, just like I am myself, then here is an example. I am making a boating game and there are raycast hits that find four points at each corner of the boat. In order to make the floating look realistic, I made it so that the average y position of all four points would be the y position of the boat. But the average rotation I cannot seem to figure out.
I have done some tests if there is a point at 0,0,0
and 1,1,0
and 0,1,1
the average rotation using xyz coordinates is -25,-25,50
and I can't seem to figure out the math behind it. (I eyeballed the final rotation in unity and it looks pretty spot on, that is how I got that number.) If anyone has seen anything about this online like an equation or way of solving this it would be a huge help.
Thanks Everyone
Stan.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道我是否正确理解了您,但是您到底是如何获得(-25,-25、50)的平均轮换?我要做的是(如果点的数量始终为三个)创建一个平面,计算该平面的正常值,并试图弄清旋转矩阵的组合导致相应的组件。
如果您的三个点是(0,0,0),(1,1,0),(0,1,1)相应的飞机的正常值为(-1、1,-1),则可以推断出为了获得满足
r_x(a) * r_y(b) * r_z(c) *(1,0,0)的参考向量((1,0,0))的参考向量((1,0,0)),必须是什么旋转。 =(-1,1,-1)
,但我想那不是你想要的,是吗?
I dont know whether I understood you correctly, but how exactly do u get an average rotation of (-25, -25, 50)? What I would do is (if the number of points are always three) create a plane, calculate the normal of that plane and trying to figure out what combination of rotation matrices lead to the corresponding components.
If your three points are (0,0,0), (1,1,0), (0,1,1) the corresponding plane's normal would be (-1, 1, -1), and from that you could deduce what the rotations must be in order to get a reference vector (lets say (1,0,0)) that satisfies
R_X(a) * R_Y(b) * R_Z(c) * (1,0,0) = (-1, 1, -1)
But I guess thats not what you want, do you?