Gaze selector in VR #242
-
Hi, does anyone ever successfully implemented a Gaze Selector using React XR in VR mode? I'm trying to get a mesh always centered in front of the view but it seems the quaternion and position I get from the frame are not accurate. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Are you talking about native https://developer.mozilla.org/en-US/docs/Web/API/XRInputSource/targetRayMode |
Beta Was this translation helpful? Give feedback.
-
You can build such a thing yourself, using the pointer-events system implemented in react-three/xr v6. Take a look at how the To retrieve the transformation of the camera follow this tutorial. This all said, most AR / VR platforms (Meta Quest headsets) already automatically add a XRInputSource inside the viewers head position in case no controllers and hands are detected, which is already used by react-three/xr v6. |
Beta Was this translation helpful? Give feedback.
You can build such a thing yourself, using the pointer-events system implemented in react-three/xr v6. Take a look at how the
DefaultXRInputSourceRayPointer
is implemented and use this information to build a ray pointer that is placed at the camera.To retrieve the transformation of the camera follow this tutorial.
This all said, most AR / VR platforms (Meta Quest headsets) already automatically add a XRInputSource inside the viewers head position in case no controllers and hands are detected, which is already used by react-three/xr v6.