Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

unity3d - Alter Unity Humanoid Bone Local Axis

Is it possible to edit a bones local axis via a C# script? I am using an external sensor strapped to my upper leg which is sending quaternion data to my unity application making the humanoid upper leg mimic my movement.

The issue is if the sensor is slightly off center on my leg the sensors axis and humanoids axis arent aligned. I need to send an offset to unity which offsets the bone local axis so my movement is accurate. This needs to be done via C# because it will constantly change everytime someone calibrates their sensors.

I have read loads of comments saying its not possible to alter a bones local axis but I was wondering if it was possible via a script. If its simply not possible doesnt anyone else have any suggestions on how I can fix my issue.

The sensor I use has fixed axis so if I rotate the x-axis on the sensor the humanoids leg will move forward and back but if I strap the sensor to my leg and its a little off center, the x-axis and z-axis are both being altered when I move my leg forward and back.

The simple fix would be changing the local axis of the bone like I mentioned above so the bones x-axis is facing the same way as the sensors x-axis.

Any help is really appreciated, I've been working on this problem for a week now.

question from:https://stackoverflow.com/questions/65850654/alter-unity-humanoid-bone-local-axis

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...