Rolling ball physics in 2D, how?

Click For Summary
SUMMARY

This discussion focuses on simulating the physics of a rolling ball in a 2D animation environment. Key parameters include mass, friction, gravity (9.81 m/s²), and initial speed (in km/h). The simulation runs at 60 frames per second, requiring calculations for distance traveled in pixels based on these inputs. Important concepts such as Moment of Inertia and energy equations are highlighted as essential for achieving an accurate simulation, particularly when considering rolling motion versus sliding.

PREREQUISITES
  • Understanding of basic physics concepts, including gravity and friction.
  • Familiarity with Moment of Inertia and its calculation for spheres.
  • Knowledge of energy conservation principles in physics.
  • Experience with animation frameworks that operate at fixed frame rates (e.g., 60 fps).
NEXT STEPS
  • Research the calculation of Moment of Inertia for different shapes, particularly spheres.
  • Learn about energy equations in physics, focusing on kinetic and potential energy.
  • Explore simulation techniques for rolling motion versus sliding motion in animations.
  • Investigate programming frameworks or libraries suitable for 2D physics simulations, such as Matter.js or p5.js.
USEFUL FOR

This discussion is beneficial for game developers, physics enthusiasts, and anyone interested in creating realistic 2D animations involving rolling objects.

C.T.
Messages
4
Reaction score
0
Im creating a little dynamic animation of a ball rolling seen from straight above. I would like the user to input the mass, friction, gravity and initial speed of the rolling ball.

I wonder how i can simulate this pretty accurate to real world.

The ball is rolling on a straight line, the x axis, and the animation is running at 60 frames per second.

I have gravity (9.81), friction, mass (kg), and initial speed (km/h).

To animate this i need the distance the ball have travelled, measured in pixel (lets say 10 pixel = 1 cm for the example), in 1/60 second (because of 60 fps) to add on ball.x (the balls position).

So, what is the formula to get distance traveled in pixels with given initial speed, mass, friction and gravity? (in case the user wants to simulate ballrolling on Pluto :-p )


Hope this made sense :)
 
Physics news on Phys.org
Describe the ramp that it's rolling down. Is it a straight incline?

cookiemonster
 
Yes there's no curve, i was thinking only 100% flat, but to add on a degree for straight incline, where the ball could roll back again could be fun :)

I thought originally that the ball had an initial speed for starting speed.
 
Now do you want to assume the ball has significant enough size that you need to consider angular energy, as well? Or would you prefer to assume that it is a point particle so you can disregard angular stuff?

The first is more accurate whereas the second is simpler, but only really an upper bound.

cookiemonster
 
hmm angular energy, on a ball? I am not quiet with you, but in the basics, its defined by one point on the x axis, so that is enough.
 
The question is do you want a rolling motion or sliding? If the ball is rolling to get a decent simulation you will need to account for the Moment of Inertia of the ball and the fact that the rolling ball has angular momentum.
 
Aha, i get it. I guess the Inertia should be in.. but i don't really understand the physics behind it. What determines the Intertia?
 
The distribution of mass.

See, we're just running around asking questions you'd never have thought about and not actually helping you. Sorry about that. =\

cookiemonster
 
Moment of inertia is determined by geometry. For a sphere

I= \frac 2 5 mr^2


You may want to find a Physic is text (Haliday and Resnick for example). This will guide you to a good solution to your problem. I recommend finding a complete solution in meters then covert to pixels only when it is time to plot on the screen.
 
  • #10
If I were you, I would work in energy. Ball starts out with some energy 'E'. This will be only potential grav energy if it starts at rest on top of the ramp. Could be both is you have an initial speed. Anyways, you can just sent up energy equations. This will make it easy to include Kinetic, Potential, Inertial, friction and so on. If you are going to make the ball spin and you haven't really worked with that subject before then you might want to leave it out. It could get a little tricky putting in spin with friction cause friction won't be sliding, it will be spinning. A few years ago in high school I spent a lot of time messing around wihjt physics in my comp sci class so i have been in the position you are in now.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 12 ·
Replies
12
Views
10K
  • · Replies 60 ·
3
Replies
60
Views
6K
  • · Replies 62 ·
3
Replies
62
Views
10K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K