Created
March 2, 2017 05:40
-
-
Save ochanje210/fd424a3cf21777f7d32e30be069b2469 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
| rotateXZ(dx, dy) { | |
| const radX = (Math.PI / 180) * dx; | |
| const cosX = Math.cos(radX); | |
| const sinX = Math.sin(radX); | |
| const radY = (Math.PI / 180) * dy; | |
| const cosY= Math.cos(radY); | |
| const sinY = Math.sin(radY); | |
| return [ | |
| cosX, -cosY * sinX, sinX * sinY, 0, | |
| sinX, cosX * cosY, -sinY * cosX, 0, | |
| 0, sinY, cosY, 0, | |
| 0, 0, 0, 1 | |
| ]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment