Search Unity

How to flip Vive Tracker from horizontal to vertical zero position

Discussion in 'AR/VR (XR) Discussion' started by am_GA, Apr 29, 2020.

  1. am_GA

    am_GA

    Joined:
    Oct 4, 2018
    Posts:
    20
    Not sure if this is more suited for the SteamVR community or Unity's:

    How can I change the Vive Tracker's default orientation from its forward-facing position being "vertical" (what it is now):



    ... to "horizontal" (imagine in the image below that the blue z-axis arrow is still pointing to the right, like in the image above):



    It's not as simple as rotating the tracked object in world space because then its vertical orientation's roll would become its horizontal orientation's yaw (see here), thus tracking movement inaccurately. There must be a setting somewhere.

    I assume its possible to track "horizontally" because there are many images of this configuration in the developer guide (as well as all over the internet):



    I must be missing something obvious! Thanks for your help.
     
    Last edited: Apr 29, 2020
  2. am_GA

    am_GA

    Joined:
    Oct 4, 2018
    Posts:
    20
    I figured it out. Indeed I was missing the obvious. The hierarchy in my scene is as follows:
    • Tracker obj (with Steam VR_Tracked Object component)
      • Gun obj (with x-rotation at 90 degrees)
    Now all raycasting should use the Gun object's orientation data, not the Tracker obj.
     
    midu77 likes this.
  3. myaydin

    myaydin

    Joined:
    Jan 19, 2021
    Posts:
    4
    I was missing something too and it drove me crazy. You saved me literally!!
    If anyone does not have VIVE Tracker correctly rotated, try the above.

    1. Create an empty object
    2. Add "Steam VR Tracked Object component"
    3. Drag your object (that you want to track) under newly created object in step 1 [hierarchy]
    4. Rotate your object (not the newly created object)
     
unityunity