Created
January 6, 2022 07:27
Revisions
-
anthonypena97 created this gist
Jan 6, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ // from work with three.js project // desktop pointer pointer.x = (event.clientX / window.innerWidth) * 2 - 1; pointer.y = - (event.clientY / window.innerHeight) * 2 + 1; // mobile touch pointer.x = +(event.targetTouches[0].pageX / window.innerWidth) * 2 + -1; pointer.y = -(event.targetTouches[0].pageY / window.innerHeight) * 2 + 1; //mobile click pointer.x = (event.clientX / window.innerWidth) * 2 - 1; pointer.y = - (event.clientY / window.innerHeight) * 2 + 1;