🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Physics for a Golf Game

Started by
5 comments, last by kressilac 24 years, 6 months ago
Hmm. this is a tough one. I think you're going to have to figure something out on your own, I haven't seen anything relating to gold physics around on the web.
Some ideas though :

wind velocity = vector addition to your ball's velocity when you shoot.

green + fairway speed : well, only effects on ce you're on the ground, but simply introduces rolling friction, of the sort :
v -= v*frictional coefficition of surface. Wind resistance you could add with the same formula but a different scalar. You could even get fancy and have the scalar change with the air pressure and temperature of the course.

ball position in stance and spin :
you can figure out some of the spin on the ball by way of determining if the club hits the ball squarely or not. If the location of impact is not in line with the ball's center of mass, it will impart spin to the ball. Do a search for physics on the web for formulas for determining the angular velocity based on impact displacement...

impact & clubhead angle : changes the vector of the ball's initial velocity. Basically you would figure out the power of the swing as it hits the ball (based on the backstroke, individual players talent, whatever), then break the velocity of the ball into its X/Y components by way of cos theta & sin theta, where theta is measuring the angle of reclination of the clubhead.

rain effects : I'd imagine that it would simply increase the wind resistance drag coefficient.


----

Really you have two questions : 1) How do I determine the correct initial velocity and spin for the ball, and 2) How do I model the flight of the ball based on these initial conditions?

Tackle them seperately, and you probably should be able to come up with a pretty good approximation -- with a fair bit of work.

------------------
- Remnant
- (Steve Schmitt)

- Remnant- (Steve Schmitt)
Advertisement
I was hoping I didn't have to pull out the old Physics book to do this but thanks for the help. I was beginning to wonder if anyone knew about coding a golf game.

Here's to delving into the world of physics once again. *cheer*

Kressilac

Derek Licciardi (Kressilac)Elysian Productions Inc.
If I were to code this, I would use vectors for everything. For things like spin this wouldn't be entirely accurate though. However, you could generally simulate the ball slicing and hooking with this technique. As far as club face angle and other type things, vectors are the way to go. Good luck.
I know this question has probably been asked before. Is there a site where I can find more information about using vectors to solve this type of problem. I am fairly new to this and will need to get up to speed rather quickly.

Thanks
Kressilac

Derek Licciardi (Kressilac)Elysian Productions Inc.
There are a lot of places, but I would try to get an old Trig or Calculus book and learn how they work. Then check out some game programming sites to see how they are used in games.
Hello all!

I am looking to try to write my own golf sim that will allow people to hit a shot and see how close they can come to the pin. Just sounds like it would be interesting to write. Does anyone know where I might be able to find an equation or two to determine the trajectory of the ball.

I am looking for a fairly complex algorithm that would take the following variables into consideration:
Wind speed and direction
Green and fairway speed
Ball position in stance and resultant ball spin
Clubface impact angle at striking point and resultant ball spin
Clubhead face degrees
Rain effects
A couple of others I can't remember at this point.

Anyway if someone could point me to a book, napkin, cdrom, website, or other source of this information, I would appreciate it.

Thanks
Kressilac

------------------
Derek Licciardi

Derek Licciardi (Kressilac)Elysian Productions Inc.
I've seen a page about the forces that matter with a flying bullet once, I think I found it on Yahoo (probably in physics or physics/mechanics). There were a LOT of them (all coriolis effects and such), but it probably doesn't have wind or rain. Try looking for it, it might help.

This topic is closed to new replies.

Advertisement