SetTransform导致Unity LeapMotion手部对象旋转过快问题求助
I’ve been battling this issue for four straight days and I’m stuck. Let me break down what I’m trying to do, what’s going wrong, and what I’ve tried so far.
My goal is to render a static hand pose (like a clenched fist) that follows the real-time position and rotation of my physical hand. So when I move my open hand around in real life, the screen should show a fist moving and rotating right along with it—no weird glitches.
First, I tried manually recalculating joint positions to lock the pose, but I ran into the same frustrating problem: the hand would spin wildly as soon as I applied the live hand’s transform. I switched to using SetTransform hoping it would be a simpler solution, but the spinning issue persists. Here’s the code I’m working with:
posedHand = PoseManager.LoadHandPose(mhd.LeftHand, int.Parse("2"), transform); Hand h = new Hand(); if(posedHand != null) { h.CopyFrom(posedHand); h.SetTransform(LiveData.LeftHand.PalmPosition.ToVector3(), LiveData.LeftHand.Rotation.ToQuaternion()); }
The weird part? The pose and position look correct initially—but the hand just won’t stop spinning non-stop.
What I really need is a reliable method that takes two Hand objects:
- The real-time live hand (with up-to-date position/rotation)
- The target posed hand (with the static pose I want to display)
And returns a Hand object that combines the two: the static pose locked in place, but moving/rotating exactly with the live hand’s movements.
Update: Visual References
To make this clearer, here’s what’s happening vs. what I need:
- Current Effect:
Pose and position are correct, but the hand spins uncontrollably. - Target Effect:
Static pose (e.g., fist) stays locked, following the live hand’s position and rotation perfectly—no spinning, just smooth, matched movement.
内容的提问来源于stack exchange,提问作者user7856951

