IWebXRPlane: getting the position from detected planes

Hi!

I’m trying to implement plane detection in React Native but have run into an issue. I can make a polygon from the data returned by the WebXRPlaneDetector.onPlaneAddedObservable, but I cannot find the position of them. So they’re all basically stuck on top of eachother.
I’ve found this Babylon.js Playground, which uses detectedplane.mesh which has all info. But that doesn’t exist on what I get returned
Screenshot 2021-07-29 at 09.37.07

Any tips?

Thanks!

oh I got it! it’s in plane.transformationMatrix.getTranslation(). I don’t know how I missed that.

You will notice that the matrix is being applied to this mesh (decomposed, to be exact). The matrix has the entire transformation you require :slight_smile:

Glad you found a solution that works for you.

1 Like