Last active
March 2, 2017 05:24
-
-
Save ochanje210/6bf748cb89ca96bd575cb6565fe634e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| handlePanResponderMove (e, gestureState) { | |
| const {dx, dy} = gestureState; | |
| const origin = {x: 0, y: 0, z: -yourSquareSidelength / 2}; | |
| let matrix = this.rotateXY(dx, dy); | |
| transformOrigin(matrix, origin); | |
| this.refViewFront.setNativeProps({style: {transform: [{perspective: 1000}, {matrix: matrix}]}}); | |
| matrix = this.rotateXY(dx + 180, dy); | |
| transformOrigin(matrix, origin); | |
| this.refViewBack.setNativeProps({style: {transform: [{perspective: 1000}, {matrix: matrix}]}}); | |
| matrix = this.rotateXY(dx + 90, dy); | |
| this.transformOrigin(matrix, origin); | |
| this.refViewRight.setNativeProps({style: {transform: [{perspective: 1000}, {matrix: matrix}]}}); | |
| matrix = this.rotateXY(dx - 90, dy); | |
| this.transformOrigin(matrix, origin); | |
| this.refViewLeft.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