请选择您的所在地
Australia
Österreich
België
Canada
Canada - Français
中国
Česká republika
Denmark
Deutschland
France
HongKong
Iceland
Ireland
Italia
日本
Korea
Latvija
Lietuva
Lëtzebuerg
Malta
المملكة العربية السعودية (Arabic)
Nederland
New Zealand
Norge
Polska
Portugal
Russia
Saudi Arabia
Southeast Asia
España
Suisse
Suomi
Sverige
台灣
Ukraine
United Kingdom
United States
请选择您的所在地
België
Česká republika
Denmark
Iceland
Ireland
Italia
Latvija
Lietuva
Lëtzebuerg
Malta
Nederland
Norge
Polska
Portugal
España
Suisse
Suomi
Sverige

Aligning VR and anchor coordinate systems using a VR controller

Use a VR controller marker to align the VR and anchor coordinate systems of your VR simulator.
Note:
  • Make sure the VIVE Wave SDK is updated to version 4.4.0 before using the coordinate alignment APIs.

  • Test the APIs before operating your VR simulator to make sure the coordinate systems work as expected.

  1. Define the offset of the VR and anchor coordinate systems.

    The offset must be defined before the VR and anchor coordinate systems can be aligned. Use the string key ClearRecenterXform to define the offset:

    Controller

    string key = "‍ClearRecenterXform"‍;
    Interop.WVR_SetParameters
    (WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key));
    Interop.WVR_SetParameters
    (WVR_DeviceType.WVR_DeviceType_Controller_Right, Marshal.StringToHGlobalAnsi(key));
    Interop.WVR_SetParameters
    (WVR_DeviceType.WVR_DeviceType_Controller_Left, Marshal.StringToHGlobalAnsi(key));
    

    Wrist tracker

    string key = "‍ClearRecenterXform"‍;
    Interop.WVR_SetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key));
    key = "‍ClearRecenterXformTR"‍;
    Interop.WVR_SetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key));
    
  2. Calculate the values for the string key used to align the VR and anchor coordinate systems.

    The string key PLAYER01InCarOrg is used to align the VR and anchor coordinate systems. Calculate the values for this string key by using the following equation by using the following equation, where T is a meter and q is the quantum angle.

    In the following illustration, the anchor coordinate system is offset from the VR coordinate system, following the right-hand rule.

    For this setup, the string key PLAYER01InCarOrg would be defined as follows:

    PLAYER01InCarOrg = -0.4,0.9,-0.4,0.0,0.0,0.0,1.0
  3. Modify the values of string key PLAYER01InCarOrg as needed and insert it in the following API.

    AIO

    string key = "‍PLAYER01InCarOrg=-0.4,0.9,-0.4,0.0,0.0,0.0,1.0"‍;
    uint RETURN_SIZE = 256;
    IntPtr value = Marshal.AllocHGlobal(new IntPtr(RETURN_SIZE));
    Interop.WVR_GetParameters(WVR_DeviceType.WVR_DeviceType_HMD, Marshal.StringToHGlobalAnsi(key), value, RETURN_SIZE);
    

    PC VR

    string key = "‍PLAYER01InCarOrg="‍;
    string setting = "‍-0.4,0.9,-0.4,0.0,0.0,0.0,1.0"‍;
    key += setting;
    string result = SendRequestMessage(DeviceType.HMD, key);
    if (string.Compare(result, "‍InitMAErr"‍) == 0)
    {
       // write your error handling code here
    }
    
提交
谢谢!您的反馈可以帮助其他人了解最有用的信息。