PTT
Submit
Submit
選擇語言
正體中文
简体中文
PTT
Marginalman
[閒聊] 數學不好 我要漬鯊了
作者:
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 rotation
https://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官方文件直接叫人不要動裏面數字 用包好函數就好此物只應天上有,不適合人類物種的概念
繼續閱讀
[閒聊] 幹三小
sole772pk37
[閒聊] 昨天晚上沒人網路壞掉嗎
buzz1067
Re: [閒聊] 你可以接受陌生人的遺物嗎?
lunawalker
Re: [閒聊] 邊緣人通常是什麼原因變成邊緣人?
Chibistars
[姆咪] 乞丐時光
digua
Re: [姆咪] 我好像戒不掉邊板了
MeiHS
[瓦特] 截圖訂閱
JerryChungYC
Re: [閒聊] 羅薛刀
runeofthunde
[閒聊] 有提供V粉婚活服務嗎
AceChen21
Re: [姆咪] 我好像戒不掉邊板了
mayolane
Links
booklink
Contact Us: admin [ a t ] ucptt.com