androidaugmented-realityarcoresceneformandroid-augmented-reality

Is it possible to determine user gaze in ARCore / Sceneform (Augmented Reality) without using Unity?


I can create a gazePointer in ARCore using Unity (as shown in: https://codelabs.developers.google.com/codelabs/arcore-intro/#10), but is it possible to do the same without Unity (just using ARCore / Sceneform)?

The functionality I need to replicate in augmented reality is to detect the user's gaze on a predefined 2D reference image, and if the gaze is more than (say) 5 seconds, then a particular action should be implemented. We can assume that the "gaze" is at the absolute center of the user's view.

Note: I'm planning to do this in stereoscopic mode of a headset like Google Cardboard (i.e. with the phone camera uncovered).


Solution

  • The ARCore Unity example you reference makes use of the Raycast function of the Frame class of the ARCore Unity API. The equivalent function in the ARCore Sceneform API appears to be the hitTest function of the Scene class.