Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var m = { x: 0, y: 0 };
- window.addEventListener('mousemove', function (e) {
- m.x = e.clientX;
- m.y = e.clientY;
- camera.position.x = (((m.x / window.innerWidth) * 2) - 1) * -1;
- camera.position.y = ((m.y / window.innerHeight) * 2) - 1;
- });
Add Comment
Please, Sign In to add comment