# Thread: Physics of a ball

1. ## Physics of a ball

So I'm rendering a sphere, and I want it to move around like a ball does. Does anyone know where I can find information on the physics involved as to the movement of a ball?

2. ## Re: Physics of a ball

First, you need a second ball. Then you need a dick. To find physical behaviour you could try self-experiments.

3. ## Re: Physics of a ball

OH, Thanx so much for the gay replys, mmmmmm....people are so helpful

4. ## Re: Physics of a ball

I suppose you're asking how to handle bouncing. That's simple : if you've got the speed vector v of the ball, after bouncing on the plane P, the new speed vector is r(v), where r is the reflection by plane P.
for example, if P is the horizontal plane (x0y), and v=(vx,vy,vz), then r(v)=(vx,vy,-vz).

Hope this helps
Morglum

5. ## Re: Physics of a ball

Well, that's not exactly what I was looking for. I want to know how a ball rolls around on a flat surface. If I give the ball momentum in a direction I want to make it roll realistically.

6. ## Re: Physics of a ball

Well, if it rolls on a flat surface, that is, a plane, all you have to check is that it's momentum matches its speed. Well, if you know its radius, where's the problem ? speed = radius * momentum ?!

7. ## Re: Physics of a ball

Oh, or maybe you're considering a momentum around a non-horizontal axis ? Like a spinning top ? Then it's more tough. You could look for any basic text on solid mechanics.

8. ## Re: Physics of a ball

I have been trying to make my ball bounce properly for days to no avail, its really beginning to piss me off now. Can anyone help please? I have tried a couple of different methods and this is as close as I have come so far, unfortunately it only on polygons facing upwards

Code :
```	if( ball.getActive( ) )
{
ball.moveBall( );
MyPolygon hit;

{
Vector3d newVector;
Vector3d hitNormal = *hit.getNormal( );
Vector3d ballMovement = *ball.getMove( );

//			cout << hitNormal << endl;

newVector = crossProduct( -ballMovement, hitNormal );
newVector = crossProduct( hitNormal, -newVector );
//			newVector.triple[ Y ] += absolute( ballMovement.triple[ Y ] );			//workaround!!
ball.setMove( newVector );
}
}```

9. ## Re: Physics of a ball

Hmmm. Sound familiar. Check this thread for part of the answer to bouncing ( http://www.opengl.org/discussion_boa...ML/008162.html ). If you want to be more realistic you can make the ball loose momentum with each bounce.

Code :
```v1 = v - 2 * dot(v, N) * N
v1 *= MomentumLoss                 // where 0 < MomentumLoss < 1.```
You can also add gravity and friction to the ball's general movement to make it more realistic. I can't help you with the rolling part though. I never figured out the maths to that.

10. ## Re: Physics of a ball

To make a ball roll should be very simple, just take a circumference of the ball.
This will give you the distance the ball will move in one rotation, then just translate and rotate the ball based on that.

Originally posted by Eclipix:
Well, that's not exactly what I was looking for. I want to know how a ball rolls around on a flat surface. If I give the ball momentum in a direction I want to make it roll realistically.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•