Skip to main content
Participant
February 6, 2025
Solved

Can I query the left and right eye pose relative to head pose?

  • February 6, 2025
  • 3 replies
  • 839 views

I see in the Custom Component Starter Sample the execute() method fetches the head pose as follows:

var headPose: Pose = getScene()!!.getViewPose()

I assume this returns the position of the head sensor on the device in the current world coordinate system. Is there a way to fetch the positions/poses of the left and right eye relative to the head position?

Follow up: is it possible to have different transforms in the ECS components depending on which eye is being rendered?

 

 

 

    This topic has been closed for replies.
    Best answer by davs

    Hi!

    Unfortunately, we don't expose getting the eye positions in app via our APIs as of right now (I will make note of this). Likewise, we don't support having separate transforms for each eyes.

     

    That being said, we do support shader branching based on which eye is rendering.

    If you are using the default materials/shaders, you can use StereoMode to set if you want the content to be Left/Right or Up/Down. You can set this on the SceneMaterial itself or in the panel configuration.

    If you are using custom shaders, you can use getStereoPassId() in your shader that returns 0 if it is rendering the left eye and 1 if it is rendering the right eye: https://github.com/meta-quest/Meta-Spatial-SDK-Samples/blob/1931b9d04f2e4979f005316127c39e926e44a1fe/MediaPlayerSample/app/src/shaders/data/shaders/custom/360.vert#L28

     

    Hope this helps!

    3 replies

    davsAnswer
    Meta Employee
    February 6, 2025

    Hi!

    Unfortunately, we don't expose getting the eye positions in app via our APIs as of right now (I will make note of this). Likewise, we don't support having separate transforms for each eyes.

     

    That being said, we do support shader branching based on which eye is rendering.

    If you are using the default materials/shaders, you can use StereoMode to set if you want the content to be Left/Right or Up/Down. You can set this on the SceneMaterial itself or in the panel configuration.

    If you are using custom shaders, you can use getStereoPassId() in your shader that returns 0 if it is rendering the left eye and 1 if it is rendering the right eye: https://github.com/meta-quest/Meta-Spatial-SDK-Samples/blob/1931b9d04f2e4979f005316127c39e926e44a1fe/MediaPlayerSample/app/src/shaders/data/shaders/custom/360.vert#L28

     

    Hope this helps!

    Participant
    March 19, 2025

    Yes -- we use getStereoPassId() and use the eyeCenter[01] uniform vars, but this does not tell us the relative position of the head sensor.

    Meta Employee
    February 6, 2025