毛.sy Posted October 12, 2020 Posted October 12, 2020 I enlarged the camera by 7 times, and then the hand position was wrong. Could you please tell me how to solve this problem? Thank you
zzy Posted October 12, 2020 Posted October 12, 2020 Hi @毛.sy We don't support changing camera scale in the current version. Can you please share your use case why you need to scale the camera in a VR application? Can you please verify if setting camera scale to (1,1,1) can solve the problem?
毛.sy Posted October 13, 2020 Author Posted October 13, 2020 Hello @zzy For some reasons, I had to enlarge the scene, so the camera was also enlarged by 7 times. However, after I enlarged the model of the camera and the hand, I found that the movement distance of the hand was still scale=1. Therefore, I would like to ask how to set the enlarged movemeHand_Tracking_Unity_CameraTest.unitypackagent distance of the hand。Thank you
zzy Posted October 15, 2020 Posted October 15, 2020 Hi @毛.sy Can you please try if the following changes solve your problem? Please change UpdateResult function in Assets\ViveHandTracking\Scripts\Engine\ViveHandTrackingEngine.cs to: public override void UpdateResult() { var transform = GestureProvider.Current.transform; IntPtr ptr; int index; var size = GestureInterface.GetGestureResult(out ptr, out index); if (index < 0) { Debug.LogError("Gesture detection stopped"); State.Status = GestureStatus.Error; State.Error = GestureFailure.Internal; return; } if (index <= lastIndex) return; lastIndex = index; if (State.Status == GestureStatus.Starting) State.Status = GestureStatus.Running; if (size <= 0) { State.LeftHand = State.RightHand = null; return; } bool isLeft = false; var structSize = Marshal.SizeOf(typeof(GestureResultRaw)); for (var i = 0; i < size; i++) { var gesture = (GestureResultRaw)Marshal.PtrToStructure(ptr, typeof(GestureResultRaw)); ptr = new IntPtr(ptr.ToInt64() + structSize); for (int j = 0; j < 21; j++) gesture.points[j] = transform.TransformPoint(gesture.points[j]); State.SetRaw(gesture); isLeft = gesture.isLeft; } if (size == 1) { if (isLeft) State.RightHand = null; else State.LeftHand = null; } }
毛.sy Posted October 16, 2020 Author Posted October 16, 2020 @zy Sorry, I didn't see it yesterday. I tried it and it was ok. Thank you very much
zzy Posted October 16, 2020 Posted October 16, 2020 Hi @毛.sy Good to know it's working. I will include this change in the next release.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now