This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright(c) June 2024 Anderson Mancini | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created by Anderson Mancini @2024 | |
// Check documentation on how to use it at https://codesandbox.io/p/sandbox/meshtransitionmaterialfree-l7pzn7 | |
import React, { useRef, useMemo } from 'react' | |
import { useFrame, useThree } from '@react-three/fiber' | |
import { easing } from 'maath' | |
export default function TransitionMaterialFree(props) { | |
const materialRef = useRef() |
OlderNewer