Hi,
Using the AR mode from WebXR, I’m trying to get the detected planes on the floor to apply a textures on it. This can be usefull to see the detected area and to preview a new floor in my room.
Is this possible to do that with the WebXR implemented in Playcanvas.
The immersive-web have some documentation about planes detection and how to get them: https://github.com/immersive-web/real-world-geometry/blob/master/plane-detection-explainer.md
// Function that's passed in to XRSession.requestAnimationFrame().
function onXRFrame(timestamp, frame) {
let detectedPlanes = frame.worldInformation.detectedPlanes;
detectedPlanes.forEach(plane => {
let planePose = frame.getPose(plane.planeSpace, xrReferenceSpace);
let planeVertices = plane.polygon; // plane.polygon is an array of objects
// containing x,y,z coordinates
// ...draw plane_vertices relative to plane_pose...
});