Jump to content
  • Advertisement
Sign in to follow this  
ClaF

Calculate how much spin a particle is given

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

Hey,
I have a particle (ball) and the user can hit the ball anywhere on its surface with a certain amount of power. How can I efficiently calculate how fast the ball will spin and in which direction? My first idea was to split the ball up into sections and depending on what section was hit (e.g. outer sections would cause the ball to spin more and inner ones would cause it to spin less), then create a coefficient with the relevant value and use that somehow, but I'm not sure if this is the best way of doing this.
thanks

Share this post


Link to post
Share on other sites
Advertisement
Are you trying to model physics for a ball? my suggestion is to apply some physics...calculate the inertia of the ball and apply torque to the ball. Is it 2d or 3d?

Share this post


Link to post
Share on other sites
Yes I am, but for a game so it doesn't have to be wholly accurate. The game is 3D.

Share this post


Link to post
Share on other sites
well, it's a lot more involved, at least you shold have a 3x3 matrix for inverse inertia tensor, inverse mass as float, position, angular velocity and linear velocity as vectors, rotation as qternion.
pick any integration method.
then make a function that applies force at specific point of the ball

Share this post


Link to post
Share on other sites
Thanks for the help. Do I need to dive that deep into it, even if It don't want to render the results? I need to perform the calculations in 3D, but won't be rendering them. I just need to know the rotation with respect to a given time.

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!