Raycast to AR planes and AR plane material

So when we enter AR, plane detection for edged horizontal surfaces is working for the placement reticule, how can I then raycast to those surfaces after placement ie. to move a product around between a table and the floor (if they are valid surfaces). Is it also possible to add a material to those planes as a preview of detected surfaces?

Original Post on Discord

by user 103054507105067008

There’s a differentiation to make: there’s two APIs in WebXR, “hit testing” and “plane tracking”. For reticle placement we use “hit testing”, which may or may not use the underlying detected planes.

More devices support hit testing than support plane tracking

That being said, planes can be visualized; I’ll add an example (may only be next week) for how to turn them into meshes and show things on them

Thanks, that makes sense, I wonder what devices don’t support plane detection although that could be more a mix of browser feature support perhaps.
Is there any example of placement with the WebXR hit test? I’m trying to make a copy of the WebXR Component and figure out how it is doing it, some method to call if in AR like webXrHitTest that returns a world position would be super useful

by user 103054507105067008

We can close this question as answered right? Seems your other posts indicate you found the right way (attach to XR events, in onBeforeRender do stuff with the XR Frame)

Only if there is a way to see the plane material if there is a way to visualize them, I’m happy for you to mark this as answered if a solution for that is definitely coming

by user 103054507105067008