FOVE SUPPORT CENTER

Camera objects in Unity

Comments

2 comments

  • Avatar
    Pierre

    Hello,

    You can inherit from FoveInterface and add methods to calculate these.

    Note that you will actually have one min and max per eye.

    The following code should work (not tested):


    public Vector3 GetMin(Eye which)
    {
    var eyeData = _stereoData[(int)which - 1];
    var eyePosOffset = eyeData.position;

    // set the camera properties to fit the eye
    transform.localPosition = _poseData.position + _poseData.orientation * eyePosOffset;
    transform.localRotation = _poseData.orientation;
    _cam.projectionMatrix = eyeData.projection;

    // calculate the value
    var min = _cam.ViewportToWorldPoint(new Vector3(0, 0, 1));

    // reset properties to original values
    _cam.ResetProjectionMatrix();
    transform.localPosition = _poseData.position;
    transform.localRotation = _poseData.orientation;

    return min;
    }

     

    Hope it helped.

    Pierre.

    0
    Comment actions Permalink
  • Avatar
    Hannes Soundso

    Hello Pierre,

    Thanks for the great answer. I'll try that.

    best,
    Hannes

    0
    Comment actions Permalink

Please sign in to leave a comment.