Created
February 5, 2018 21:07
-
-
Save thiagopnts/f1725f13c39ae29807b489b52b842048 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
const direction = this.viewer.camera.getWorldDirection(); | |
const theta = Math.atan2(direction.x, direction.z); | |
const angle = (theta * 180 / Math.PI + 90) * -1; | |
this.$compass.style.transform = `rotate(${angle}deg)`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment