Moving ball colliding with a side of a cube

  • Thread starter Thread starter muffinman123
  • Start date Start date
  • Tags Tags
    Ball Cube
Click For Summary
SUMMARY

The discussion focuses on determining the side of a cube that a moving ball collides with, given the ball's linear path, known position, and velocity. The solution involves calculating the line equation of the ball and the plane equations for the six sides of the cube. The intersection of these equations will reveal the specific side of the cube impacted by the ball. The problem is simplified by assuming the ball's radius is negligible and the cube's dimensions are defined by its corners at (0,0,0) and (1,1,1).

PREREQUISITES
  • Understanding of 3D geometry and coordinate systems
  • Knowledge of line equations in three-dimensional space
  • Familiarity with plane equations derived from points in 3D
  • Basic skills in solving intersection problems in geometry
NEXT STEPS
  • Study the derivation of line equations in 3D geometry
  • Learn how to formulate plane equations from three points in space
  • Research methods for calculating intersections between lines and planes
  • Explore practical applications of collision detection in computer graphics
USEFUL FOR

Students in physics or computer science, game developers, and anyone interested in collision detection algorithms in 3D environments.

muffinman123
Messages
17
Reaction score
0

Homework Statement



assuming the path of the ball is linear, if the ball collides with the cube, I want to find which side the cube the ball collided with. this is a discreet problem, the ball's position and velocity are always known. the cube's size is bigger than the ball's size in the way that the ball's radius is negligible in this problem, and the time step is small enough so that the change in position of the ball in different time step is also small enough.


Homework Equations



line equation using ball's current position and velocity
plane equation using 3 corners of a side of the cube

The Attempt at a Solution



I figured the collision took place once the ball just penetrates the cube, and the solution is to determine the line equation of the ball and the plane equation of the six sides of the box and determine which plane the line segment is intersecting.

the problem is I don't know how to calculate the equation of the line in 3D and equation of planes and then calculation for the intersections. I have forgotten much of the math needed to solve problems like this...
 
Physics news on Phys.org
Where they touch one co-ordinate will match one of the co-ordinates of the plane and the others will be in bounds. So consider a cube with one corner at the origin (0,0,0) and another at (1,1,1). Then you can check if the surface of the ball is on one of the faces eg if any of these conditions are true..

0, 0<y<1, 0<z<1
or
1, 0<y<1, 0<z<1
or
0<x<1, 0, 0<z<1
or
0<x<1, 1, 0<z<1
or
0<x<1, 0<y<1, 0
or
0<x<1, 0<y<1, 1
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
34
Views
3K
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 20 ·
Replies
20
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 20 ·
Replies
20
Views
4K