EloiStree / HelloQuest3

Exploration of what we can do on the Quest 3 with a XR focus.
https://github.com/EloiStree
1 stars 0 forks source link

Question: What happens if you use sidequest Q3 video as stereo image in Unity ? #50

Open EloiStree opened 11 months ago

EloiStree commented 11 months ago

image

The image need a shader to unbend the UV. As the screen image is design for the lens of the Quest 3.

This script can help your to try around moving two panels.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class StereoMoveAndScalePanelsMono : MonoBehaviour
{

    [Range(0.03f, 5f)]
    public float m_depth_z = 0.5f;
    [Range(0, 0.5f)]
    public float m_eyeDistance_x = 0.5f;
    [Range(0,1.8f)]
    public float m_localPanelScale = 0.5f;

    public Transform m_leftEye;
    public Transform m_rightEye;

    void Update()
    {

        if (m_leftEye!=null && m_rightEye!=null) {
            Vector3 localleft= Vector3.zero, localRight = Vector3.zero;
            localleft.z = m_depth_z;
            localRight.z = m_depth_z;
            localleft.x = -m_eyeDistance_x;
            localRight.x= m_eyeDistance_x;
            m_leftEye.localPosition = localleft;
            m_rightEye.localPosition = localRight;
            m_leftEye.localScale = Vector3.one * m_localPanelScale;
            m_rightEye.localScale = Vector3.one * m_localPanelScale;
        }

    }
}