Skip to content

Instantly share code, notes, and snippets.

View ektogamat's full-sized avatar
👋

Anderson Mancini ektogamat

👋
View GitHub Profile
@ektogamat
ektogamat / AnimateCamera.jsx
Created March 14, 2024 01:22
useGSAP with React Three Fiber Camera Animation
import { useThree } from '@react-three/fiber'
import { gsap } from 'gsap'
import { useGSAP } from '@gsap/react'
export default function AnimateCamera() {
// Accessing camera from Three.js
const { camera } = useThree()
useGSAP(() => { // The new hook will take care of context and life cicle.
gsap.fromTo( // Creates the animation
@ektogamat
ektogamat / Confetti.js
Created May 10, 2024 00:21
Confetti V2 for React Three Fiber
// CONFETTI COMPONENT V2 BY ANDERSON MANCINI - CC 2024
// If you use, please credit it :)
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { useFrame } from '@react-three/fiber'
import * as THREE from 'three'
import { Instance, Instances } from '@react-three/drei'
/**
* ExplosionConfetti component creates a confetti explosion effect in a three.js scene.