Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane detection should be promise based #15

Open
cabanier opened this issue Aug 14, 2019 · 2 comments
Open

Plane detection should be promise based #15

cabanier opened this issue Aug 14, 2019 · 2 comments

Comments

@cabanier
Copy link
Member

From the proposal:

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...
 });

"planes" are usually requested by a user pointing to a certain area and then the logic tries to detect a plane in that area. It's not an ongoing process (such as meshing and headpose).

I think it would be better if this API takes a direction and some sort of area and then returns a promise with the detected planes.

@bialpio
Copy link
Contributor

bialpio commented Mar 17, 2021

Revisiting this.

I think it's important to be able to maintain identity of the detected planes across multiple frames (so that we have a way of saying that "plane A disappeared in this frame", "plane B got modified in this frame") - do you know if that is something that is possible on systems where plane detection is not an ongoing process? Would it be possible to keep requesting detected planes over the entire area in front of the device to simulate it being an ongoing process?

Implementation note is that both ARKit and ARCore expose plane detection as an ongoing process. Based on my internet searches, Unity seems to have added abstractions to their AR Foundation that build on top of those APIs that also looks like an on going process.

@cabanier
Copy link
Member Author

I no longer work for Magic Leap so I can't comment on how their plane logic works.
However, if theirs was event based, it seems that it could be adapted to your proposal that maintains a list of detected planes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants