Skip to content

Instantly share code, notes, and snippets.

@baharev
Created July 9, 2014 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save baharev/ca5d658eae72cf063bbd to your computer and use it in GitHub Desktop.
Save baharev/ca5d658eae72cf063bbd to your computer and use it in GitHub Desktop.
SensorManager.getRotationMatrixFromVector(rotationMatrix, sensorValues);
SensorManager.getAngleChange(orientationValues, rotationMatrix, prevMatrix);
final float SCALE = 1.0f; // Please experiment with several scales: 0.1f, 1.0f, 10.f, etc.
pixel.x += orientationValues[0] * SCALE;
pixel.y += orientationValues[1] * SCALE; // in the video, the indices were swapped, perhaps that matters?
prevMatrix = rotationMatrix;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment