diff --git a/stiq4tf18d.js b/stiq4tf18d.js index 5a4de11..d7caa24 100644 --- a/stiq4tf18d.js +++ b/stiq4tf18d.js @@ -7,10 +7,16 @@ if (!this.initialized) { this.initialized = true; } -this.camera.position.x = ((window.innerWidth / 2 - data.event.clientX) / 15) + 32; -this.camera.position.y = ((window.innerHeight / 2 + data.event.clientY) / 15) - 32; +this.camera.position.x = 0.2 * (window.innerWidth - (window.innerWidth / 2 + data.event.clientX)); +this.camera.position.y = -0.2 * (window.innerHeight - (window.innerHeight / 2 + data.event.clientY)); +this.camera.position.z = Math.cos(this.camera.position.y / 100) * Math.sin(this.camera.position.x / 100) * 100; this.camera.updateInstance('position'); -//console.log('camera x:' + this.camera.position.x + ',x: ' + data.event.clientX + ',y: ' + data.event.clientY); +this.camera.lookAt.x = 32; +this.camera.lookAt.y = 32; +this.camera.lookAt.z = 0; +this.camera.updateInstance('lookAt'); + +console.log('camera x:' + this.camera.position.x + ',y: ' + this.camera.position.y + ',z: ' + this.camera.position.z); //@ sourceURL=mouseMove.js \ No newline at end of file