Replies: 1 comment 6 replies
-
i made a mistake in that sandbox, it's wrong, the aspect isn't supposed to change. it should be: const aspect = useMemo(() => new THREE.Vector2(512, 512), [])
as for your ref, that indicates a bug in your code, the ref changes, but for some reason you're stuck in a closure. but either way, the above fix will make it run. generally i would recommend react-spring (see https://codesandbox.io/s/r3f-react-spring-basic-demo-8ckyf?from-embed) and lerping for animation. GSAP is fine, but it clashes with the declarative react approach. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is anyone else using GSAP and React-Three-Fiber do queue up more complex animations?
We have it working in most scenerio's save for one that is causing a bit of a challenge.
We have a animation similar to in this example https://codesandbox.io/embed/r3f-sparks-sbf2i that uses the
UnrealBloomPass
where we are animating thestrength
.We read in the R3F's do's/don't that its not great to animate rapid values in JSX but instead to use a ref. We are doing this but the UnrealBloomPass seems to recreate the object anytime you resize the browser, but its NOT causing our ref to change, so our animations are running on the old object.
Anyone have this sort of thing happen and know of a work around?
Beta Was this translation helpful? Give feedback.
All reactions