[闲聊] 数学不好 我要渍鲨了

楼主: ZooseWu (N5)   2022-11-01 17:22:39
有个套件负责拿东西
它会计算手的角度跟物品的角度算出一个反转值
让物品拿起来的时候会在手上转正
handAttachmentPointTransform.rotation * initialRotationalOffset
但是我不想要这个功能
所以我要反向算出逆的选转角
让它拿起来的时候会保持物品当时的角度
但是我数学不好
不知道怎么乘才能反向算回去
我这辈子就这样了
已经试过的方法
1.
Quaternion.Inverse(handAttachmentPointTransform.rotation) *
Quaternion.Inverse(initialRotationalOffset)
2.
handAttachmentPointTransform.rotation *
Quaternion.Inverse(initialRotationalOffset)
3.
Quaternion.Inverse(handAttachmentPointTransform.rotation) *
initialRotationalOffset
4.
handAttachmentPointTransform.rotation * initialRotationalOffset
5.
initialRotationalOffset
6.
handAttachmentPointTransform.rotation
7.
Quaternion.Inverse(hand.hoverSphereTransform.localRotation) *
transform.localRotation
8.
HandOffsetRotation.rotation
9.
hoverSphereTransform.position
10.
Quaternion.Inverse(hand.hoverSphereTransform.localRotation)
11.
Quaternion.Inverse(hoverSphereTransform.position)
还有一些杂七杂八的没记下来
作者: Jaka (Jaka)   2022-11-01 17:24:00
大师==
作者: bigbowl ( Gathering Storm。)   2022-11-01 17:25:00
hello world
作者: SuicideComet (|)   2022-11-01 17:26:00
我知道 除以initialRotationalOffset就可以了
作者: x0003 (镜子)   2022-11-01 17:26:00
System.Println("Marginalman");
楼主: ZooseWu (N5)   2022-11-01 17:27:00
四元数没有除法
作者: SuicideComet (|)   2022-11-01 17:27:00
我知道了 在捡之前加一个事件纪录物件角度捡完之后设回去
作者: bigbowl ( Gathering Storm。)   2022-11-01 17:28:00
不能直接停止计算rotaition吗?
楼主: ZooseWu (N5)   2022-11-01 17:29:00
它会平滑的转过去 每一侦都调整一次会有bug停止计算要直接改底层 更麻烦我希望初始旋转值固定 但是拿起来之后手转它会跟着转所以不能单纯地把旋转相关的功能都拔掉
作者: bigbowl ( Gathering Storm。)   2022-11-01 17:30:00
只要停止拿到东西那祯呢?
作者: SuicideComet (|)   2022-11-01 17:30:00
把套件拔掉 自己重写
作者: bigbowl ( Gathering Storm。)   2022-11-01 17:31:00
或是插一个reverse的计算?
作者: WayThuz (欢喜利乐包)   2022-11-01 17:33:00
他没有什么toggle能fix rotation之类的吗
作者: emptie ([ ])   2022-11-01 17:38:00
Quaternions and 3d rotationhttps://www.youtube.com/watch?v=zjMuIxRvygQ记得乘法没有交换律
作者: Stella (钢琴控)   2022-11-01 17:44:00
这是用欧拉角吗欧拉角可以直接用逆矩阵返回去
作者: emptie ([ ])   2022-11-01 17:46:00
四元数就是有一些比矩阵好用的性质才被拿来做3d旋转吧。但我也没用过 所以了解的非常不深入
作者: Stella (钢琴控)   2022-11-01 17:48:00
力学课本都用欧拉角
作者: SuicideComet (|)   2022-11-01 17:56:00
四元数跟欧拉角不同 是更复杂的概念 然后unity官方文件直接叫人不要动里面数字 用包好函数就好此物只应天上有,不适合人类物种的概念

Links booklink

Contact Us: admin [ a t ] ucptt.com