Created
May 7, 2022 21:06
-
-
Save 112KA/e210d36218d6a0780cd64d76ebf345df to your computer and use it in GitHub Desktop.
Screen to world point
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
function _onTouchMove(e) { | |
_mousePosition | |
//マウススクリーン位置 | |
.set( | |
(e.clientX / window.innerWidth) * 2 - 1, | |
-(e.clientY / window.innerHeight) * 2 + 1, | |
0 | |
) | |
.unproject(camera) | |
.sub(camera.position) | |
.normalize() | |
.multiplyScalar(camera.position.length()) | |
.add(camera.position); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment