Guest User

Untitled

a guest
Jan 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. var m = { x: 0, y: 0 };
  2. window.addEventListener('mousemove', function (e) {
  3. m.x = e.clientX;
  4. m.y = e.clientY;
  5. camera.position.x = (((m.x / window.innerWidth) * 2) - 1) * -1;
  6. camera.position.y = ((m.y / window.innerHeight) * 2) - 1;
  7. });
Add Comment
Please, Sign In to add comment