Created
March 2, 2017 04:38
-
-
Save ochanje210/14fe4c19ff141409262678744ea52c1f to your computer and use it in GitHub Desktop.
This file contains 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
rotateXY(dx, dy) { | |
const radX = (Math.PI / 180) * dy; | |
const cosX = Math.cos(radX); | |
const sinX = Math.sin(radX); | |
const radY = (Math.PI / 180) * -dx; | |
const cosY= Math.cos(radY); | |
const sinY = Math.sin(radY); | |
return [ | |
cosY, sinX * sinY, cosX * sinY, 0, | |
0, cosX, -sinX, 0, | |
-sinY, cosY * sinX, cosX * cosY, 0, | |
0, 0, 0, 1 | |
]; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment