Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Hold hmd(vive) Position and Rotation ?

Discussion in 'AR/VR (XR) Discussion' started by lghna, Jul 30, 2020.

  1. lghna

    lghna

    Joined:
    May 15, 2019
    Posts:
    3
    hi,
    I'm trying to freeze(hold) the vive's position and rotation in the unity scene,
    Is there a way to override the hmd(vive) position and rotation for holding specified position and rotation value..?
    I'm using steam vr asset.

    Previously, i made a render texture(from other camera) and follow the texture in front of hmd(vive) like below code,

    void Update()
    {
    Vector3 pos = hmd.transform.position
    + hmd.transform.forward * distance.z
    + hmd.transform.up * distance.y
    + hmd.transform.right * distance.x;

    Quaternion rot = hmd.transform.rotation;

    frontobj.transform.position = pos;
    frontobj.transform.rotation = rot;
    }

    the render textured mesh is located in front of hmd(vive), but the textured mesh is shaking and
    fluttering in the hmd(vive) screen ( it's okay in the unity editor screen, but not okay in the hmd(vive) screen )

    So, i trying to find a way to freeze or hold the hmd(vive) position and rotation for alternative method..
     
unityunity