I developed an Augmented Reality application using the front-camera and the min3d library. This application works fine on the Samsung Galaxy Tab 10,1 (first generation), running Android 4.0.4
But testing this same application (landscape mode only) on the ASUS Transformer TF700T with Android 4.1.1 give wrong orientation back and the augmented world does not match any more to the camera view.
The following code is used for getting the orientation vectors target_axis and up_axis needed for min3D:
SensorManager.getRotationMatrix(mR, null, mLastAccelerometer, mLastMagnetometer);
SensorManager.getOrientation(mR, mOrientation);
Number3d target_axis = new Number3d( -mR[2], -mR[5], -mR[8] );
Number3d up_axis = new Number3d( mR[1], mR[4], mR[7] );
The mLastAccelerometer and mLastMagnetometer are received from an onSensorChanged(SensorEvent event)
Can somebody tell me if the above code is still too much device dependent? I would expect that using the SensorManager's gerOrientation call this solution should work throughout different devices?