jbienzms / SpatialAlignment

Helpful components for aligning and keeping virtual objects aligned with the physical world.
MIT License
35 stars 5 forks source link

Support for weighted values across multiple parents #23

Closed jbienzms closed 5 years ago

jbienzms commented 5 years ago

The current implementation of multi-parent actually selects a single "favored" parent. This is being addressed in #4, but in the new approach we should provide an option for using "weighted values" across parents.

What

The scene contains two parents, A and B. A and B both have different positions, offsets and rotations.

And so on.

If there are 3 parents A, B and C, the weighted values will take into account all 3 parents.

Why

Spatial anchor systems tend to be valuable and sometimes finite resources. With ARCore and ARKit, for example, each anchor incurs a performance penalty. On HoloLens there is a higher limit, but there is still recommended limit to the overall count of spatial anchors. And of course QR Codes require physical printing and placement in the environment.

A "Weighted Values" system will provide improved alignment between anchors. It will also reduces (or even eliminate) the "popping" that occurs when switching between anchors. Together, such a system will dramatically reduce the total number of anchors needed for the same given area.

How

It is recommended that we implement this solution using Inverse Distance Weighted Interpolation. IDW allows the weight to be calculated as a percentage of the distance between all parents. IDW also has a configurable Power Factor which can be used to influence the weights toward or away from the nearest parent.

jbienzms commented 5 years ago

Resolved by #25