-
Notifications
You must be signed in to change notification settings - Fork 13
Comments on the planes-explainer #2
Description
A few high level comments, rather than doing detailed editing.
-
Is the intent of the having objects per "kind of world knowledge" be to allow relatively complex configuration? For example, we could eventually pass in significant configuration for things like object and image trackers/detectors? (this seems reasonable)
-
I'm less keen on having the planes be a field in returned value; this implies that any kind of info will be in it's own area. Why aren't planes a kind of mesh? If all things that are meshs are meshes, then an app that cares only about meshes (for occlusion, for example, or drawing pretty effects on anything known in the world) can just deal with that.
meshes.forEach(mesh => {
let pose = mesh.getPose(xrReferenceSpace); // origin of mesh or plane
if (mesh.isPlane) {
// mesh.polygon is an array of vertices defining the boundary of 2D polygon
// containing x,y,z coordinates
let planeVertices = mesh.polygon;
// ...draw plane_vertices relative to pose...
} else {
// draw more general mesh that isn't a special kind of mesh
// the plane mesh would also have
let vertices = mesh.vertices // vertices for the mesh. For planes, might be the same
// as mesh.polygon plus one at the origin
let triangles = mesh.triangles // the triangles using the vertices
// ... draw mesh relative to post
}
});
-
I agree with synchronous, but why are things only valid in the rAF? As your example shows, the first thing people will do is copy it. This seems massively wasteful for non-trivial amounts of world info. Why not just say it's valid through the start of the next rAF?
-
why is this pull instead of push? Forcing folks to poll and step through the data to see if anything has changed seems awkward. In our polyfill we used two things:
- events. When an existing thing had it's values changed, a subscriber could be notified. This is the pattern used in the anchor proposal, for example.
- difference lists. In addition to the "current" plane (mesh) set, we had a list of new mesh objects and a list of deleted mesh objects available, so apps could update their internal data structures as needed.