• Advertisement
Sign in to follow this  

Physics of a spinning ball bouncing off a wall (2D)?

This topic is 3929 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello to everyone in the community! I'm a brand new member, and I gotta say, this place looks very promising. I look forward to coming here often for giving and getting help. So anyway, here's the deal. In my 2D bat-and-ball themed game, I'm currently working on the engine for the bouncing ball, and I've implemented some physics dealing with spin, because players will be allowed to give the ball rotational velocity based on how their paddle moves. So far, I've succesfully been able to put in the Magnus Effect, so that the ball's path curves when the ball is rotating. The task I now face is the handling of wall collisions. Sure, I got the ball bouncing perfectly off the walls, at the correct angles for a ball with NO spin. But now, what if the ball HAS spin and hits a wall? Because of the friction between the ball and the wall, the ball's velocity should be affected by its rotation speed during the time of impact. My question is, how is it affected? What formula can I use to calculate the ball's final X and Y velocity and spin after the bounce based on its current spin and the wall's angle? I've thought about this myself, and here's what I came up with. In my game, the variable 'spin' for the ball corresponds to the rotational velocity in pixels per game-frame of any OUTERMOST point on the ball, where positive velocity implies clockwise rotation and negative velocity is counterclockwise. So now, with this in mind, with a 'spin' of +X, let's say the ball hits a perfectly horizontal wall below it. At the moment of impact, ONE point on the ball will be touching the wall, the bottommost point on the ball, right? Logically, if the outer surface of the ball is spinning clockwise, then at the current moment, the bottommost point on the ball will be moving perfectly LEFT at a speed of X. Assuming the friction between the ball and wall is maximal, the ball's rotational velocity X should be ADDED to the ball's horizontal velocity (x_speed), and then the 'spin' variable should be set back to 0, since it is no longer spinning. Similarly, if the wall is at an angle, X should be added to the ball's velocity in that angle. (I have an addVelocity function that takes as its parameters an amount and an angle, so all that will be easy). Isn't what I thought up logical? Well, being a table tennis player I thought about how a ping pong ball moves and bounces when given heavy spin. If it is given heavy topspin, it curves downwards, and upon hitting the table surface, shoots forward. Following the previous paragraph's concepts, it makes sense why this would happen. But now here's what's puzzling me. If you give the ball backspin (underspin, bottomspin, whatever), and send the ball flying at a very acute angle onto the opponent's side, when the ball bounces, instead of simply slowing down, it SHOOTS UPWARDS (in my game, this would correspond to a change in the Y Velocity). Following the concepts in the previous paragraph, this doesn't make sense. Why would the Y Velocity be affected if the ball hits a perfectly horizontal surface? Shouldn't it only be the X Velocity affected, because the point on the ball that touches the horizontal surface is only going to be moving horizontally? So why?? That's why I'm sure my thinking is wrong, and there's some formula I haven't been able to find. I'm guessing that the influence spin has on the bounce is based on the ball's current angle and movement speed. What could it be? I've looked at the webpages on the physics of ping pong, air hockey, and billiards, but I just cannot find any explanations for a spinning ball bouncing off a wall! Is it really THAT simple? Haha! I was hoping someone here might be able to help me out with this. If you're going - "What the HECK is he talking about? I didn't understand a word..." just ask me to explain it again and I'll be glad to, because I desperately need help on this! Thanks a lot guys (and girls :P), - Dalal EDIT: Too lazy to read all the stuff above? Well, here's a better way of phrasing my question: In a 2D game, where the ball has an X Velocity, Y Velocity, and Spin Velocity, how are each of these amounts affected when the ball hits a wall? There, much simpler, I hope. Haha! [Edited by - Dalal on July 16, 2007 4:44:30 AM]

Share this post


Link to post
Share on other sites
Advertisement
The magnus effect is what is affecting the ball... This website might help..

Towards the bottom it talks about the bounce...
Clicky

Share this post


Link to post
Share on other sites
Thanks for your reply Stiffler,

I wouldn't have thought of golf, so it's definitely a good thing you mentioned it, but unfortunately the website you linked to didn't seem to have any information on spin affecting bounce :P In the bounce section, it simply talked of slopes and surface changing the height of the ball bounce. Nowhere did it mention spin in the bounce section. Or maybe I missed something?

The Magnus Effect only affects the trajectory of the ball IN THE AIR, while what I want to know now is how the bounce of the ball is affected based on its spin. In other words, during impact, how does the rotation speed of the ball change AND how does the X and Y velocity of the ball change? If I could find ANY resource on this, it would help me tremendously. Unfortunately, all my search terms have failed me on Google, which is why I ultimately turned to GameDev, haha!

Well, this thread is still open to more replies! Help :P

Share this post


Link to post
Share on other sites
i might be wrong, but technically, when modelling something as a perfect circle or perfect sphere the contact normal runs directly into the centre of mass, and any angular momentum would not be able to alter linear momentum and only friction can change the angular momentum no?

I mean im not a physics expert, i've only went through Mech 1 and 2 of Alevel maths, but from what i've learnt friction is directly related to normal contact force, which is unchanged by rotation in a perfect circle/sphere?

Share this post


Link to post
Share on other sites
I appreciate all your replies! Thanks!

To jjd: I've looked into dynamic friction before, but haven't been able to relate it to spin. All I understand is that the ball's acceleration along the line normal to the wall is directly proportional to the amount of friction. I don't understand how this friction affects the bounce of the ball based on the ball's spin. Could you explain a little more?

To luca: For a circle, I agree that that friction is unchanged by its rotational velocity, but what I'm trying to find is how the ball's rotational velocity affects it's linear velocity after a bounce. Friction appears to be one of the factors influencing this behavior.

Here's some other things to think about:
- Today, I was talking to my dad (who incidentally majored in physics at one point), and he was telling me that in tennis, topspin on the ball makes the ball bounce higher. This puzzled me, because I couldn't and still can't understand how spin affects vertical velocity. What the heck?
- In table tennis, I've observed that sometimes, if you put heavy topspin on the ball, but simply let it drop on the table (with no horizontal velocity), then on the first bounce it will gain a LITTLE horizontal velocity, on the second, a little MORE, on the third, EVEN more... etc. Weird! It's like the gain in horizontal velocity depends on the previous horizontal velocity. I wish it was easy to understand how all this spin crap works, jeez!
- In table tennis, if you lob the ball along with applying heavy backspin, when it hits the opponent's side (and it's horizontal velocity is close to zero), it'll spin back towards you. If you send a really low ball with heavy backspin, when it hits the other side, the ball will jump upwards.
- If you are holding a basketball and you spin it and drop it, will it gain more horizontal speed after a bounce from a higher height or a lower height? I just thought of this now, but right now it's the middle of the night and everyone's asleep in the apartment. Don't want to bounce a basketball right now, but no harm including it in my post :P

Okay, that's all. Hope you can help!

Thanks again! (Looking for more replies :P)

Share this post


Link to post
Share on other sites
I don't have answers, but I can help you frame your thoughts a little better.

Assuming that changes in trajectory are caused by friction, if you apply the frictional force perpendicular to the normal at the contact point, you can apply torque and change the linear velocity, too.

Unfortunately, since collisions are taken generally to be instantaneous, I was never able to see how these frictional forces were able to change the outgoing velocity of the bounce.

Share this post


Link to post
Share on other sites
Appreciate it Numsgil! And a good point you brought up is the fact that the collisions I'm talking about would be inelastic in reality, but elastic in a game simulation. So I'll need to change a few things to compensate for this difference as well.

But I have to say now, wow, I never knew something as simple as a spin off a wall would be so complex that it makes it difficult to answer :P Ultimately, I may end up constructing my own formula to handle the collision detection. I'll just make it up based on what looks right. Guess and check... haha!

But anyway, the thread starter would appreciate ANY additional attempts to help!! This thread is open to more replies! If you feel you have anything to contribute, please post your thoughts! Thanks!!

Share this post


Link to post
Share on other sites
Quote:
Original post by Dalal
...how spin affects vertical velocity. What the heck?

A few minutes with google turned up hits for Tennis Science for Tennis Players, here.

Check out pages 69 and 70:

Topspin makes the ball dive, hitting the ground at higher speed than it would if it had no spin. Since it hits with greater speed, it rebounds with greater speed and thus bounces higher.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement