WebAR - How to create a plane align to floor

How to create a plane align to floor and move the plane based on the pointer move in Web AR.

@RaananW our VXAR master is currently in vacation but I bet he ll have an answer for you when he ll be back in about 3 weeks.

In the meantime I wonder if @syntheticmagus has any feedback

Also you are probably looking at the hit test feature ? WebXR Augmented Reality Features | Babylon.js Documentation


Hi Krishna_Kishore,

I think sebavan’s advice to look into the hit test feature is probably the best place to start. However, if for some reason you can’t use hit test, this is also the kind of problem where you can get a long way with a couple convenient assumptions. In particular, Y is up, floors are flat, most phone-based AR experiences are used while standing, and people tend to be about 1.6 meters tall and hold their phones around sternum-height. This suggests that, if your scenario is typical, you can get a rough but probably serviceable guess as to where the floor is by just assuming it’s in the plane parallel to XZ with a Y value 1 to 1.2 meters less than the starting Y of the device. This won’t be perfect, of course, but it should work well in a surprising number of scenarios; and, if hit test for some reason isn’t what you’re looking for in your scenario, this might be worth a shot. Hope this helps, and best of luck!


for now this one solved my problem.


Another question how rotate mesh in web AR using touch swipe events

In local floor mode (the default mode) your floor should be in y=0, but that won’t work in different scenarios, and might not be exact. Hit test, add everyone suggested, is your best option.

About rotating with touch gestures, you can attach a gizmo to the mesh: Gizmos | Babylon.js Documentation