Calculate ball velocities after slope bounce

  • Thread starter Thread starter DrKrunklehorn
  • Start date Start date
  • Tags Tags
    Ball Bounce Slope
Click For Summary
SUMMARY

The discussion focuses on calculating the correct ball velocity after a bounce off a sloped surface, specifically a rotating racket. The user successfully detects 2D collisions but struggles with determining the new direction of the ball post-collision. The proposed solution involves using the incident angle and reflection angle, but the user finds inconsistencies when the racket is tilted. A suggested approach includes utilizing vectors and rotation methods, such as matrices or quaternions, to accurately compute the bounce direction.

PREREQUISITES
  • Understanding of 2D collision detection
  • Basic knowledge of trigonometry
  • Familiarity with vector mathematics
  • Experience with matrix and quaternion transformations
NEXT STEPS
  • Research vector reflection techniques in physics simulations
  • Learn about matrix transformations for rotating vectors
  • Explore quaternion mathematics for 3D rotations
  • Investigate collision response algorithms in game development
USEFUL FOR

Game developers, physics simulation programmers, and students working on projects involving collision detection and response mechanics.

DrKrunklehorn
Messages
5
Reaction score
0

Homework Statement



Hello! I'm working on my final project for a programming class. Currently I can successfully
detect 2D collision between a ball, and a line that can rotate in any direction.

However when the ball hits the line I need to change it's velocity so it bounces
in the right direction. I'm not worrying about elasticity or friction or anything, just
post collision direction.

Homework Equations



I know basic Trig is involved and maybe Dot product, but I'm pretty sure we don't need that.

The Attempt at a Solution



I thought if the racket was horizontal, it would be as easy as incident angle = reflection
angle. But as the racket tilts upward I pictured the reflection angle decreases at the same
time.

So I tried taking the racket's rotation relative to the ground and subtract it from the ball's
movement angle. This I thought would be the new angle of reflection.

Sadly it didn't work out. Sometimes the ball sort of bounces in the right direction but it's
really shoddy.

Thanks for the assistance!
 
Physics news on Phys.org
Why not work out the vectors for the case that the racket is at zero degrees then rotate the vectors by the racket angle using either matrix or quaternion methods. You may need to detect if that ball hits the top or the bottom of the racket.
 

Similar threads

Replies
16
Views
3K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 13 ·
Replies
13
Views
9K
Replies
10
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 32 ·
2
Replies
32
Views
3K
Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K