|
-
Aug 20th, 2007, 12:03 PM
#1
Effect of gravity between point A and B
I'll try not to confuse anyone with this... I have a gravity simulator built. Works pretty well, except that the math is missing one vital piece. Right now, it takes object A and computes the effect of gravity from every other object on the screen, based on mass and distance. Then it applies the total force to the current velocity and comes up with a new position for the next frame. Unfortunately, what's happening is a small object gets maybe 2 pixels from a large object, gets a LARGE boost of momentum, and the next frame it's 10 pixels away, going the other direction. This results in objects being flung around rather unrealistically. What I need to come up with is a way to calculate the total effect of gravity for every point in between points A and B, so things will balance out and behave correctly.
Does that make sense?
If so, where would be a good place to start?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|