import { useGSAP } from "@gsap/react"; import { Center } from "@react-three/drei"; import gsap from "gsap"; import { useRef } from "react"; import * as THREE from "three"; import { CustomMaterial } from "./material"; export const Item4 = () => { const ring1Ref = useRef(null); const ring2Ref = useRef(null); const cone1Ref = useRef(null); const cone2Ref = useRef(null); const groupRef = useRef(null); useGSAP(() => { if ( ring1Ref.current && ring2Ref.current && cone1Ref.current && cone2Ref.current && groupRef.current ) { gsap .timeline({ repeat: -1, }) .to( ring1Ref.current.rotation, { z: `+=${Math.PI * 2}`, x: `+=${Math.PI * 2}`, duration: 4, ease: "none", }, 0 ) .to( ring2Ref.current.rotation, { z: `-=${Math.PI * 2}`, x: `-=${Math.PI * 2}`, ease: "none", duration: 4, }, 0 ) .to( groupRef.current.rotation, { y: Math.PI * 2, duration: 4, ease: "none", }, 0 ); } }, []); return (
); };