dorukeker / gyronorm.js

JavaScript project for accessing and normalizing the accelerometer and gyroscope data on mobile devices
MIT License
641 stars 65 forks source link

Support for absolute orientation #58

Closed AlexZeller closed 6 years ago

AlexZeller commented 6 years ago

Hello, I am using gyronorm.js to try to build a VR/AR Application in combination with Cesium.js (A 3D mapping library). The idea is to discover the terrain around you by pointing your phone.

The problem is, that I need the absolute orientation values with respect to the Earth’s coordinate frame. I have tried GyroNorm.WORLD as well as GyroNorm.GAME but both return relative parameters.

Is there support for absolute orientation or is it a limitation of the browser?

Thanks

dorukeker commented 6 years ago

Not sure which browser you are using; so it might be due to the browser. Also please have a look in the API docs how the GyroNorm.WORLD and GyroNorm.GAME works.

Having said those: if you wanna have AR/VR on the browser I recommend that you take a look at webvr or A-frame. These are much more up-to-date compared to gyronorm. Web AR is also available but not widely supported main stream browsers yet.

AlexZeller commented 6 years ago

Sorry, I forgot to mention. I now tested on Chrome and Firefox on both an IOS and Android Device.

I implemented the orientation base as follows:

var args = {            
    orientationBase:GyroNorm.WORLD      
};
gn.init(args).then(function(){
    gn.start(function(data){
    }
}

For some reason I do get absolute orientation values on all browsers now. So it was some mistake on my part (maybe an old version of my javascript was cached).

Sorry for bothering you. Thanks for your help.

dorukeker commented 6 years ago

You are welcome! @AlexZeller