Posted February 17, 20232 yr Hello I have a question. I want to display a particle that will move around a circle. Currently, my method for ticking looks like this: @Override public void tick() { super.tick(); x = centerX + radius * Math.cos(2 * Math.PI * (age / 20f) / time); z = centerZ + radius * Math.sin(2 * Math.PI * (age / 20f) / time); } The "time" variable means the time it takes the particle to complete one circle. The problem is that changing the radius value changes the speed of the particle. I want a constant speed, independent of the radius. How can I get rid of the time variable? Ideally, the speed should be predefined. This means that regardless of the radius of the circle, the particle always moves at a fixed speed. Then "time" will be unnecessary. Is there a way? I will be grateful for your help!
February 17, 20232 yr it makes sense coze your calculatin particule position using age as angle if you change (age / 20f) for (age / 40f) would take 2 full seconds to complete a round
February 17, 20232 yr Author 4 minutes ago, perromercenary00 said: it makes sense coze your calculatin particule position using age as angle if you change (age / 20f) for (age / 40f) would take 2 full seconds to complete a round Thanks for the answer! However, my point is to set the speed constant, not by editing the time of the entire rotation.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.