I’ve already managed to make the tunnel, but I’m stuck on the particles:
I’ve managed to make one mesh that comes out of the tunnel and comes towards the viewer, but the movement is really staggered and I’m wondering how I could make it smoother
I’m struggling to make a group of particles: I can’t make a separate component because the particles’ position are based on data from the tunnel.
But why? SetState is for reactive data, its purpose is to re-render the component. In your code burst is treated like a common variable, so why not just plain javascript:
I think you’re struggling with more basic concepts here, reactivity mostly, and maybe this isn’t the right place to look for input. Don’t know if it’s OK to recommend https://pmnd.rs/discord where r3f is being made, but the community here is probably relieved not having to see React stuff all day so it can focus on threejs and webgl.
I’ve worked on my sandbox, and there are 2 main things I don’t understand, and I would be super grateful if you could expand a bit on it!
1/ On the useFrame for the mesh particle movement, I’m using the exact same values as in the threejs example, and I get the movement direction right, but it the movement looks really staggered and I’m wondering why…
2/ to update the tube’s curve value based on the mouse’s mouvement, I get really weird results by using normal variables and changing the mesh ref itself… using updates on state inside the useFrame() work well though - I know it’s bad practice so I’m wondering why…