diff --git a/bundle/vue-three-d-mockup.esm.js b/bundle/vue-three-d-mockup.esm.js index 95c268a..f459c94 100644 --- a/bundle/vue-three-d-mockup.esm.js +++ b/bundle/vue-three-d-mockup.esm.js @@ -99,12 +99,9 @@ class MockupModel extends Group { lookAtAnim(dt, { x, y, z }) { const target = new Vector3(); - // const boxTarget = new Vector3(); - // const boundingBox = new Box3().setFromObject(this); - // boundingBox.getSize(boxTarget); - target.x = x; - target.y = y; - target.z = z; + target.x = x - this.position.x; + target.y = y - this.position.y; + target.z = z - this.position.z; this.lookAt(target); } } @@ -306,7 +303,7 @@ var script = { if (phones.length) { phones.forEach((phone) => { - phone.animation(deltaTime, { x: mouseX, y: mouseY, z: camera.position.z }); + phone.animation(deltaTime, { x: mouseX / 2, y: mouseY / 2, z: camera.position.z }); }); } diff --git a/src/Demo.vue b/src/Demo.vue index a1406fc..4e604af 100644 --- a/src/Demo.vue +++ b/src/Demo.vue @@ -21,6 +21,10 @@ z: -0.06, }]" /> +