microsoft / HoloJS

Provides a framework for creating holographic apps using JavaScript and WebGL.
MIT License
1.19k stars 114 forks source link

Spatial Anchors Between Devices #153

Closed omaralcheikh closed 6 years ago

omaralcheikh commented 6 years ago

Hello Cristi,

It seems that anchors are not working properly between devices here is what I'm doing to import an anchor that is saved in my DB.

I first call the service to retrieve the buffer from the DB I then call the import function to import the anchor After that I save the anchor with a specified name In the end I open the anchor and position the object using the same logic you have in the example


 holographic.anchors.importAnchors(http.response, function (result) {
       holographic.anchors.saveAnchor(result[0].anchor, "exportedCubeLocation", function (result2) {
            if (result2.success === true) {
               holographic.anchors.openAnchor("exportedCubeLocation", function (anchor) {
                      //positioning logic
               });
            }
       });
});

Doing the above on the same device works great. However doing it on another device positions the object at 0,0,0

omaralcheikh commented 6 years ago

Hello Cristi,

I was trying this again and it seems to be working properly. Maybe i was too excited when trying it the first time and the other hololens did not manage to map properly and thats why it wasnt able to anchor the cube properly.