Closed agGitHub closed 2 years ago
The HitTest in a 3D only context will return something only if it hit something (a Node). What are you trying to achieve?
Sorry. I didn't read your question fully. I will have a look at it since it's one of the next goal for SceneView. You should give a try to Filament Pick API which you should be able to use within Sceneform and which will replace 3D (non AR) actual hitTest in SceneView
While speaking about hitTest, just to let you and others know, in SceneView, we have made the choice to use the ARCore depth hitTest instead of the DepthLab way: own hitTest system based on the Depth Image. So the Filament Pick API will be the only one available for 3D only usage.
@agGitHub Please let us know your results if you give a try with the Filament Pick API and link question you could ask them here.
Thanks for your answers. Actually, it seems that the problem was due to the backdrop.glb model. For some reasons, it doesn't respond to raycast/hittest. Perhaps because it seems to have no texture or a transparent texture (it is covered with the typical 'checkerboard' texture of the 'alpha color'). Or perhaps another bug on this glb model. I imported a GLTF model and it works. Will tell you if I have new info.
I confirm that it is a bug due to backdrop.glb (probably because it has a kind of transparent texture), not due to the glb format. Indeed, I just tested hittest with the other glb model present in your sample (dragon.glb) ; it has a texture, and it receives hittests correctly.
Hi,
In the following sample:
https://github.com/SceneView/sceneform-android/blob/master/samples/3d-model-viewer/src/main/java/com/google/ar/sceneform/samples/sceneviewbackground/MainActivity.java (3D viewer without ARCore)
I removed the backgroundSceneView in order to keep only the transparentSceneView in full screen.
Then, I do (in a onFrameUpdate loop):
ray0 equals:
[Origin:[x=0.0, y=4.543066E-6, z=-0.01], Direction:[x=0.0, y=4.5430654E-4, z=-0.9999999]]
=> seems correcthitTestAll gives the following point:
[x=0.0, y=4.543066E-6, z=-0.01]
=> seems not correct as the model backdrop.glb is located at position (0,0,-1).Is there any bug with hitTest? Or am I missing something?
Thanks.