simon-heinen / droidar

DroidAR Mobile Locationbased Augmented Reality Framework for Android
GNU General Public License v3.0
225 stars 274 forks source link

GL objects static on screen #16

Closed rvieras closed 10 years ago

rvieras commented 10 years ago

Hey, I have been using your library and I have come across a issue with a few devices. On the Galaxy tab 2 (10.1) and Nexus 5 device and some Nexus 7 devices I have seen that the GL images seem to be static on the screen and do not move with the device. The two images below is what I see when trying to use your example setups StaticDemoSetup.java and PlaceObjectsSetupTwo.java on the Galaxy tab 2. Any direction on how to fix this?

image_one ^^ Above image from your example project "Demo Setup" Note: there is a line that goes from the top of the screen to the center then runs out on right its a little hard to see but that image stays on the screen.

image_two ^^ Above image from your example project "Placing Objects 2"

simon-heinen commented 10 years ago

hm looks like the sensors of your device are not used at all. take a look at the default ar setup implementation where the orientation source is set. you will have to create your own one to control the virtual camera or you have to find the bug in the settings of the orientation source. you can also try to test the other orientation sources which for example do not use the gyroscope

rvieras commented 10 years ago

Ok, I put some logs into the ActionWithSensorProcessing and EventManager classes and found out that the Sensor.TYPE_ROTATION_VECTOR fails to be registered for the Galaxy tab 2 (10.1) (cannot test the other devices as I currently do no have them on hand). Are there any alternatives to Sensor.TYPE_ROTATION_VECTOR if a device does not support that sensor type?

janionano commented 10 years ago

When debugging in Moto G, sensorManager.getDefaultSensor(Sensor.TYPE_ROTATION_VECTOR) also returns null. Are there any alternatives to Sensor.TYPE_ROTATION_VECTOR if a device does not support that sensor type? ²

simon-heinen commented 10 years ago

I think TYPE_ROTATION_VECTOR only works when the device has a gyroscope. Check the https://github.com/bitstars/droidar/blob/master/droidar/src/system/EventManager.java there the method registerSensorUpdates(..

understand it and from where it is called and change your setup accordingly so that only the acceleration and magnetometer are used