Last active
October 30, 2024 14:10
-
-
Save ektogamat/1f93fc5056abf56ac6b342fb50c5836c to your computer and use it in GitHub Desktop.
Revisions
-
ektogamat revised this gist
Oct 28, 2024 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ // 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' -
ektogamat created this gist
Oct 27, 2024 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ 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() useFrame((_, delta) => easing.dampC( materialRef.current.color, props.transitionColor, props.transitionTime ? props.transitionTime : 0.25, delta ) ) return <meshPhysicalMaterial ref={materialRef} {...props} /> }