Jump to content
  • Advertisement
Sign in to follow this  

physics help

This topic is 2052 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

hi there. I have been working on a pool simulator in DarkBasic for a while now and it doesnt work correctly. And i cant see why. 


so the problem is that when sliding on the table the balls angular velocity doesnt change as fast as it does in real life ( i have a pool table available so i have checked it over and over. (i also found some highspeed videos online which confirm the error) 


I use the following to calculate the motion of the ball on the table:



V = vector for velocity of ball

W = vector for angular velocity of ball

P = vector for position of ball

Vt = vector for perimeter velocity at contact point ( with table)

r = radius of ball

R = vector from center of ball to the table ( length r)

m = mass ( 0.16 kg )

g = acceleration due gravity ( 9.81)

us = coefficient of friction while slipping (0.2) ( have tried all kinds of values)

ur = coefficient of friction while rolling (0.01)

x is cross product

d is delta

dt = time-step of the simulation ( on the order of 5x10^-5 )


Vt = (R x W) + V

if Vt = 0 then the ball is rolling without any slip

dV = -us*g*dt*(Vt/|Vt|)                                 (Vt/|Vt|) is the unit vector in direction Vt

V = V+dV

dW = [(-us*m*g*r*(Vt/|Vt|)]x R) * (5*dt)/(2*m*r^2)

W = W+dW

if the ball is rolling:

    V = V-(ur*g*dt)*(Vt/|Vt|)


Wz = Wz*(1-uz*dt)               where Wz is the z(perpendicular to table) component of the angular velocity and uz is a friction to slow it down ( nothing in the "real" physics would stop pure z spin)


this seems to produce approximately 10-15 times too weak dW. Why is this?


any help very much appreciated 






Share this post

Link to post
Share on other sites

Where did you get the equation for dW? It's very difficult to dissect the entirety of this problem without knowing where the equations came from.

Share this post

Link to post
Share on other sites

sorry, i will clarify:


from newton, F = ma -> F = m*dv/dt 

Fu = u*N                                                                            force of friction = coefficient of friction times normal force

Fu = u*m*g*(r?)                                                              

cant say i see why the r is there now that i think of it i got this from here where it says so but cant see why? maybe this explains it. with my radius of 0.02857 it would cause quite the difference at least.


Fu x R = torque caused by the friction force

T = I*a                                                                                 Torque = moment of inertia times angular accelleration

T = I*dw/dt                                     

dw = T*dt/I


moment of inertia for a sphere is (2/5)*mass*radius^2


thank you for your time

Share this post

Link to post
Share on other sites

The torque is given by R x F, not F x R.


In the z-direction: N=mg. In the forward direction: ma=-uNv^=-umgv^=f, where f is the force due to friction.

The torque on the contact point is then R x f = -umgr (r^ x v^) = I dw/dt, so dw = -(5ug)/(2r) dt (r^ x v^).


If Ww^ (magnitude and direction) is the current angular momentum, the update after euler integration is [ W w^ - ((5ug)/(2r)) (r^ x v^) dt ].


There is more analysis that could be done, but check if this sign change in the cross product does anything for you.

Edited by deekr

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!