particle wont center #2241
Unanswered
adhiartawika
asked this question in
Q&A
Replies: 1 comment
-
The issue is that positions are a flat array where all coordinates exist in one dimension. They're mapped like this.
In your loop, you're moving the particle in the x, y, and z, axes simultaneously.
To have all the particles fly away from the camera, you have to target the z axes. What I do is increase my index value by three, then calculate the other two. Once you have the index for the specific axes, you can do your calculation.
Here is a modified version of your example with this setup |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi guys i recently start experimenting lots of thing using points to make a particle effect and one of it try to create is a space wrap animation, the animation is correctly display but the position of the effect it wont center, it always goes in right or left i try to change the camera type and the position of the canvas camera it seems it doesn't help at all i think am missing something. can anyone help me to figure this out am quite confused if its the camera or the logic of the particle that wrong here is the code am working on hope it help thank you
https://codesandbox.io/s/spacewrap-l82e3s?file=/src/App.js:0-1784
Beta Was this translation helpful? Give feedback.
All reactions