Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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!

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 

  • 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.