Update: CC - SpoonLib - MouseMove (stiq4tf18d.js) 271 bytes modified
parent
ab8319f9cc
commit
0c6608e4c0
|
@ -7,10 +7,16 @@ if (!this.initialized) {
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.camera.position.x = ((window.innerWidth / 2 - data.event.clientX) / 15) + 32;
|
this.camera.position.x = 0.2 * (window.innerWidth - (window.innerWidth / 2 + data.event.clientX));
|
||||||
this.camera.position.y = ((window.innerHeight / 2 + data.event.clientY) / 15) - 32;
|
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');
|
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
|
//@ sourceURL=mouseMove.js
|
Loading…
Reference in New Issue