Skip to content

Instantly share code, notes, and snippets.

@ochanje210
Last active March 2, 2017 05:05
Show Gist options
  • Select an option

  • Save ochanje210/a39330df8df5d154162acb5e036730fa to your computer and use it in GitHub Desktop.

Select an option

Save ochanje210/a39330df8df5d154162acb5e036730fa to your computer and use it in GitHub Desktop.
handlePanResponderMove (e, gestureState) {
const {dx, dy} = gestureState;
const sideLength = 100;
const origin = {x: 0, y: 0, z: -sideLength / 2};
let matrix = this.rotateX(dx, dy);
// from https://gist.github.com/jmurzy/0d62c0b5ea88ca806c16b5e8a16deb6a#file-foldview-transformutil-transformorigin-js
transformOrigin(matrix, origin);
this.refView.setNativeProps({style: {transform: [{perspective: 1000}, {matrix: matrix}]}});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment