Jump to content
 
Sign in to follow this  
h-shirakami

How to Change Head Location

Recommended Posts

How can I temporarily rotate and move the HMD camera by myself in VIU?

I wanted to rotate the HMD's camera when an event occurred, so I rotated the ViveCameraRig, but I couldn't get the correct results.

I referred to Teleport in Examples.
It rotates the x-axis after moving forward, which is not the intended result. I think the cause is the movement of the camera. How can I change the camera transform directly?

 

teleport01.png

teleport02.png

teleport03.png

Share this post


Link to post
Share on other sites

Do you mean you want to rotate camera root around HMD?

public static void RotateAroundHMD(Transform vrOrigin, Transform hmd, Quaternion rot)
{
    vrOrigin.position = rot * (vrOrigin.position - hmd.position) + hmd.position;
    vrOrigin.rotation = rot * vrOrigin.rotation;
}

public static void OnSomeRightTurnEventOcurred()
{
    // Turn right around Y axis for 45 degree
    RotateAroundHMD(vrOrigin, hmd, Quaternion.Euler(new Vector3(0f, 45f, 0f)));
}

 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You need to be a member in order to leave a comment

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...