|
|
|
@ -1,5 +1,6 @@ |
|
|
|
import * as THREE from "three"; |
|
|
|
import {CSG} from "three-csg-ts"; |
|
|
|
import gsap from 'gsap' |
|
|
|
//@ts-ignore
|
|
|
|
import {mergeGeometries} from 'three/addons/utils/BufferGeometryUtils.js' |
|
|
|
|
|
|
|
@ -444,4 +445,137 @@ export default class Clx3dObject extends THREE.Object3D { |
|
|
|
this.add(clxGemelMeshR2) |
|
|
|
} |
|
|
|
|
|
|
|
animationShowFork(z: number): gsap.core.Tween { |
|
|
|
const clxFork = this.getObjectByName('clxFork') |
|
|
|
const clxGemelMeshL1 = this.getObjectByName('clxGemelMeshL1') |
|
|
|
const clxGemelMeshL2 = this.getObjectByName('clxGemelMeshL2') |
|
|
|
const clxGemelMeshR1 = this.getObjectByName('clxGemelMeshR1') |
|
|
|
const clxGemelMeshR2 = this.getObjectByName('clxGemelMeshR2') |
|
|
|
|
|
|
|
const fy = clxFork.position.y |
|
|
|
|
|
|
|
const ac = Math.asin(z/(2 * 0.8)) |
|
|
|
|
|
|
|
// clxGemelMeshL1.position.z = 0.5 - z/4
|
|
|
|
// clxGemelMeshL1.position.y = fy + 0.72
|
|
|
|
// clxGemelMeshL1.rotation.x = -ac
|
|
|
|
gsap.to(clxGemelMeshL1.position, { |
|
|
|
z: 0.5 - z/4, |
|
|
|
y: fy + 0.72, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
gsap.to(clxGemelMeshL1.rotation, { |
|
|
|
x: -ac, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
// clxGemelMeshL2.position.z = 0.5 - z/4 * 3
|
|
|
|
// clxGemelMeshL2.position.y = fy + 0.72
|
|
|
|
// clxGemelMeshL2.rotation.x = -ac
|
|
|
|
gsap.to(clxGemelMeshL2.position, { |
|
|
|
z: 0.5 - z/4 * 3, |
|
|
|
y: fy + 0.72, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
gsap.to(clxGemelMeshL2.rotation, { |
|
|
|
x: -ac, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
|
|
|
|
// clxGemelMeshR1.position.z = 0.5 - z/4
|
|
|
|
// clxGemelMeshR1.position.y = fy + 0.72
|
|
|
|
// clxGemelMeshR1.rotation.x = ac
|
|
|
|
gsap.to(clxGemelMeshR1.position, { |
|
|
|
z: 0.5 - z/4, |
|
|
|
y: fy + 0.72, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
gsap.to(clxGemelMeshR1.rotation, { |
|
|
|
x: ac, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
|
|
|
|
// clxGemelMeshR2.position.z = 0.5 - z/4 * 3
|
|
|
|
// clxGemelMeshR2.position.y = fy + 0.72
|
|
|
|
// clxGemelMeshR2.rotation.x = ac
|
|
|
|
gsap.to(clxGemelMeshR2.position, { |
|
|
|
z: 0.5 - z/4 * 3, |
|
|
|
y: fy + 0.72, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
gsap.to(clxGemelMeshR2.rotation, { |
|
|
|
x: ac, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
|
|
|
|
return gsap.to(clxFork.position, { |
|
|
|
z: -z, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
} |
|
|
|
animationHideFork(): gsap.core.Tween { |
|
|
|
return this.animationShowFork(0) |
|
|
|
} |
|
|
|
|
|
|
|
animationUpFork(y: number): gsap.core.Tween { |
|
|
|
const clxFork = this.getObjectByName('clxFork') |
|
|
|
const clxGemelMeshL1 = this.getObjectByName('clxGemelMeshL1') |
|
|
|
const clxGemelMeshL2 = this.getObjectByName('clxGemelMeshL2') |
|
|
|
const clxGemelMeshR1 = this.getObjectByName('clxGemelMeshR1') |
|
|
|
const clxGemelMeshR2 = this.getObjectByName('clxGemelMeshR2') |
|
|
|
|
|
|
|
gsap.to(clxGemelMeshL1.position, { |
|
|
|
y: y + 0.72, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
gsap.to(clxGemelMeshL2.position, { |
|
|
|
y: y + 0.72, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
gsap.to(clxGemelMeshR1.position, { |
|
|
|
y: y + 0.72, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
gsap.to(clxGemelMeshR2.position, { |
|
|
|
y: y + 0.72, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
|
|
|
|
return gsap.to(clxFork.position, { |
|
|
|
y: y, |
|
|
|
duration: 3, |
|
|
|
repeat: 0, |
|
|
|
ease: 'sine.inOut' |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
animationDownFork(): gsap.core.Tween { |
|
|
|
return this.animationUpFork(0) |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|