1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

fix slider2

This commit is contained in:
Kevin Levron 2021-04-04 22:00:48 +02:00
parent 31cf5e99f2
commit 714b4776d7

View File

@ -1,5 +1,5 @@
<template>
<Renderer ref="renderer" antialias resize mouse-move>
<Renderer ref="renderer" antialias resize pointer>
<OrthographicCamera ref="camera" :position="{ z: 10 }" />
<Scene ref="scene" />
</Renderer>
@ -85,8 +85,8 @@ export default defineComponent({
scene.add(this.image2.mesh);
},
animate() {
const { mouse } = this.three;
this.center.copy(mouse).divideScalar(2).addScalar(0.5);
const { positionN } = this.three.pointer;
this.center.copy(positionN).divideScalar(2).addScalar(0.5);
lerpv2(this.image1.uCenter.value, this.center, 0.1);
lerpv2(this.image2.uCenter.value, this.center, 0.1);