Forum Discussion
xinuo.2023
2 years agoHonored Guest
Want to use custom pose to generate a cube
Hi guys, I'm new to the world of oculus. I just recently customised a gesture and want to generate a cube from a gesture. I do it once to generate it, but how do I get the real-time position of my hand? I'm kind of stuck!
2 Replies
- willmanningHonored Guest
Hi xinuo.2023! The Interaction SDK package makes this all easy to achieve:
- Here is the getting started guide to follow: https://developer.oculus.com/documentation/unity/unity-isdk-getting-started/
- Here is the specific tutorial for building a custom hand pose: https://developer.oculus.com/documentation/unity/unity-isdk-building-hand-pose-recognizer/
- You can see pre-built pose examples in the PoseExamples sample: https://developer.oculus.com/documentation/unity/unity-isdk-example-scenes/#poseexamples
Let me know if that helps!
- Big_FlexMeta Employee
Hi xinuo.2023, I work on the Interaction SDK team, so tag me if you have any future questions or comments! I'd use one of the joint methods from the IHand script. The GetRootPose method would work well, but feel free to test the others. Since IHand is already implemented by GameObjects like HandDataLeft, you can reference one of those GameObjects in a script to access the method.
Here's an example of a custom script accessing a bone location. A full list of bones is in the HandPrimitives script as part of enum HandJointId.
using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; using Oculus.Interaction.Input; public class LogBoneLocation : MonoBehaviour { [SerializeField] private Hand hand; private Pose currentPose; private HandJointId handJointId = HandJointId.HandIndex3; // TO DO: Change this to your bone. A full list of bones is in the HandPrimitives script in enum HandJointId. void Update() { hand.GetJointPose(handJointId, out currentPose); } }
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 months ago
- 3 months ago