- Home /
Align HTC Vive Coordinate with OptiTrack System in Unity
I am working on aligning HTC Vive Controller (for example, right controller) with a rigid body marker which is tracked by Optitrack. Since the coordinate system of both systems are different how can I align these two systems? I am trying to move the rigid body marker similar to the right-hand controller of the htc vive.
Scenario:
I have a unity environment which is viewed using HTC Vive and now I want to have a rigid body marker which is tracked by Optitrack and have to align properly while I move the marker in the environment.
Any suggestions would be very helpful.
Thank you.
I have a similar issue to you - have you had any luck yet?
It seems to me that the method ought to go something like this: 1. Capture a common point in physical space in each tracking system (system 1 & system 2) 2. Use that info to calculate the transform of the origin of system 2 in the coordinate system of system 1 3. Parent the tracked transform of system 2 to a game object at system 2's calculated origin transform.
Unfortunately - try as I might - I can't seem to figure out the maths either!
Answer by Jon_Olive · Apr 21, 2020 at 10:02 AM
HI. Further to my comment above - I think I've cracked how to do it.
Essentially the process is indeed as I described above - the key is figuring out the origin of System 2 in the coordinate space of system 1. To do this - capture a common physical point in space with both tracking systems. Then Parent system 2 tracker transform (the one you want to translate) to a gameobject at worldspace origin - then you need to line up sys 2 tracker transform with that of sys 1 in such a way that the parent moves relative to it. The parent transform is then the origin of sys 2 in sys1's coordinate system! I did that with the help of the code in this post: https://answers.unity.com/questions/460064/align-parent-object-using-child-object-as-point-of.html
Your answer
![](https://koobas.hobune.stream/wayback/20220612160748im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity is a Left-Handed Coordinate System? Why? 5 Answers
TextMesh Pro characterInfo coordinates 1 Answer
Load notification panel when at a particular location 0 Answers
move sprites in side scrolling 2d game in screen coordinates 0 Answers
How to apply point value on local coordinate system rather than world coordinate system 1 Answer