Search Unity

allows users to view 360º content without a VR headset

Discussion in 'VR' started by unity_eaKm_7FNf4Uaww, Jun 13, 2019.

  1. unity_eaKm_7FNf4Uaww

    unity_eaKm_7FNf4Uaww

    Joined:
    Mar 14, 2019
    Posts:
    6
    Allows users to view 360º content without a VR headset.
    I have read the article and used the script from the below link.
    https://developers.google.com/vr/develop/unity/guides/magic-window?authuser=1

    this is working perfectly fine. check this code:
    transform.localRotation =
    // Allow user to drag left/right to adjust direction they're facing.
    Quaternion.Euler (0f, -dragYawDegrees, 0f) *

    // Neutral position is phone held upright, not flat on a table.
    Quaternion.Euler (90f, 0f, 0f) *

    // Sensor reading, assuming default `Input.compensateSensors == true`.
    Input.gyro.attitude *

    // So image is not upside down.
    Quaternion.Euler (0f, 0f, 180f);

    which helps in dragging left/right. But I also want to swipe upward/downward. Does anyone have idea how can I do this using the script available in the above link?
     
  2. FMark92

    FMark92

    Joined:
    May 18, 2017
    Posts:
    1,229
    What does?
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    5,347
    i'd guess need to add
    dragPitchDegrees += touch.deltaPosition.y * DRAG_RATE;
    and then use it in the localRotation = ...