diff --git a/Examples/UIExplorer/TransformExample.js b/Examples/UIExplorer/TransformExample.js index 7da9eb5ac4e424..85bc2920f3adfd 100644 --- a/Examples/UIExplorer/TransformExample.js +++ b/Examples/UIExplorer/TransformExample.js @@ -179,6 +179,32 @@ var styles = StyleSheet.create({ {scale: 2}, ], }, + box6step1: { + backgroundColor: 'maroon', + height: 50, + position: 'absolute', + left: 0, + top: 0, + width: 50, + transform: [ + {translate: [100, 100]}, + {rotateX: '60deg'}, + {scale: 3}, + ], + }, + box6step2: { + backgroundColor: 'maroon', + height: 50, + position: 'absolute', + left: 0, + top: 0, + width: 50, + transform: [ + {rotateY: '60deg'}, + {translate: [100, 100]}, + {scale: 3}, + ], + }, flipCardContainer: { marginVertical: 40, flex: 1, @@ -284,5 +310,27 @@ exports.examples = [ ); } - } + }, + { + title: 'Translate, RotateX, Scale', + description: "translate: [100, 100], rotateX: '60deg', scale: 3", + render() { + return ( + + + + ); + } + }, + { + title: 'Translate, RotateY, Scale', + description: "translate: [100, 100], rotateY: '60deg', scale: 3", + render() { + return ( + + + + ); + } + }, ]; diff --git a/Libraries/Utilities/MatrixMath.js b/Libraries/Utilities/MatrixMath.js index 23db73811f1896..77910b8ab43105 100755 --- a/Libraries/Utilities/MatrixMath.js +++ b/Libraries/Utilities/MatrixMath.js @@ -464,10 +464,10 @@ var MatrixMath = { // Solve the equation by inverting perspectiveMatrix and multiplying // rightHandSide by the inverse. - var inversePerspectiveMatrix = MatrixMath.inverse3x3( + var inversePerspectiveMatrix = MatrixMath.inverse( perspectiveMatrix ); - var transposedInversePerspectiveMatrix = MatrixMath.transpose4x4( + var transposedInversePerspectiveMatrix = MatrixMath.transpose( inversePerspectiveMatrix ); var perspective = MatrixMath.multiplyVectorByMatrix( @@ -582,6 +582,8 @@ var MatrixMath = { translation, rotate: rotationDegrees[2], + rotateX: rotationDegrees[0], + rotateY: rotationDegrees[1], scaleX: scale[0], scaleY: scale[1], translateX: translation[0], diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java index c5dcaa70073674..201effea750e9b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java @@ -18,6 +18,8 @@ public abstract class BaseViewManager