Announcement

Collapse
No announcement yet.

How/Where can I retrieve World Space position data for the Left and Right eye Camera?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How/Where can I retrieve World Space position data for the Left and Right eye Camera?

    I've been scouring the forums, documentation, and source code for two days now without any success. I'm working on a seamless portal system for VR, so I would need the position offsets of the Left and Right eye cameras to position my Left and Right eye's CanvasSceneCapture2D cameras correctly.

    Found the answer, see my reply.
    Last edited by MLarsson98; 02-13-2020, 11:36 AM.

    #2
    As usual, you always manage to find the solution after asking for help, however, in local space, it can easily get converted into World Space though.

    Code:
        FQuat LeftEyeRot;
        FVector LeftEyeLoc;
        GEngine->XRSystem->GetRelativeEyePose(IXRTrackingSystem::HMDDeviceId, EStereoscopicPass::eSSP_LEFT_EYE, LeftEyeRot, LeftEyeLoc);
    
        FQuat RightEyeRot;
        FVector RightEyeLoc;
        GEngine->XRSystem->GetRelativeEyePose(IXRTrackingSystem::HMDDeviceId, EStereoscopicPass::eSSP_RIGHT_EYE, RightEyeRot, RightEyeLoc);
    
        SceneCaptureLeft->SetRelativeLocationAndRotation(LeftEyeLoc, LeftEyeRot);
        SceneCaptureRight->SetRelativeLocationAndRotation(RightEyeLoc, RightEyeRot);

    Comment


      #3
      You can also do this with left and right direction vectors from the camera position multiplied by 1\2 the interpupillary distance. Useful in material graphs that use camera position, though it definitely has its counter-use cases.

      Comment


        #4
        NotSoAccurateNo1 Thanks, makes sense, however, I wasn't able to find any interpupillary distance either, although, I was only looking for that quite briefly.

        Comment

        Working...
        X