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 non-MRTK projects #3

Open jbienzms opened 5 years ago

jbienzms commented 5 years ago

SpatialAlignment would be helpful for other platforms including iOS and Android, but currently components of the library require MRTK. (Specifically RefinableModel uses TwoHand and BoundingBoxRig). The library should be reorganized in some way that allows the MRTK-dependent components to be deselected during library import.

xiaomaoo commented 5 years ago

SpatialAlignment would be helpful for other platforms including iOS and Android, but currently components of the library require MRTK. (Specifically RefinableModel uses TwoHand and BoundingBoxRig). The library should be reorganized in some way that allows the MRTK-dependent components to be deselected during library import.

I try to run this project, however there are some problems 20181224232312

AvinZarlez commented 5 years ago

@xiaomaoo It seems like you are missing the Mixed Reality Toolkit in your project https://github.com/Microsoft/MixedRealityToolkit-Unity

As this issue states, it would be a nice feature if this supported non-MRTK projects. Right now, that is not the case.

xiaomaoo commented 5 years ago

@xiaomaoo It seems like you are missing the Mixed Reality Toolkit in your project https://github.com/Microsoft/MixedRealityToolkit-Unity

As this issue states, it would be a nice feature if this supported non-MRTK projects. Right now, that is not the case.

Thanks for reply! Now I have fixed all errors,and deploy the SA-RefinementBuilding scene into my Hololens. I tried the Ray refinement works and it works well. However, when I run the app next time, the building is not where I aligned. How can the alignment data be saved ? I konw the Persistence scene shows how the data saved using Jsonstore, but I dont konw how the Jsonstore used in the SA-RefinementBuilding

jbienzms commented 5 years ago

@xiaomaoo very sorry for the late reply. I honestly missed the GitHub notification about your message among other e-mails after I returned from holiday.

You are correct that this library should ideally be functional without the MRTK. In fact I intend to remove RefinableModel for now because TwoHand and BoundingBoxRig do not work correctly when you are "inside" the hologram (as is the case when positioning building-scale models). Ray Refinement and Nudge Refinement work far better in this scenario anyway.

I did want to mention that we are considering contributing this library into the MRTK. However, we would not plan to do that until MRTK v-Next ships. v-Next has much better support for isolated or "standalone" components which can be used on their own without taking a dependency on the rest of the MRTK. We would love to hear your thoughts on that approach.

jbienzms commented 5 years ago

@xiaomaoo I forgot to answer your question about persistence. You're correct that the Persistence sample is the right place to look. Right now that sample serializes the spatial graph into a json string or deserializes a json string into a spatial graph. I think it's good feedback that this sample could be improved.

The SA-RefinementBuilding sample does not currently use persistence. The way I would probably implement it is to have a voice command that saves the spatial graph to a text file in the applications isolated storage folder. The next time the application runs I would check to see if that file exists and if so I would load the spatial graph from that file instead of starting with a new spatial graph.

I hope that makes sense. I will create a new issue about improving those samples.