some questions about forces...
hi,
i've become very interested in the physics aspect of game development lately, and yesterday i tried making something (look at the bottom for a download link) i never knew how to. one day (the day before yesterday, actually) i sat down with a pen and some paper, and started to think how i would do it. what i had in my mind is to have an origin point, which would be controlled by your mouse. and to that point, i would have a "metal rod" connected, on the end of which, there's another heavy ball. the metal rod does not stretch nor does it shrink. the point of that is when you move the mouse around, the ball will spin around the origin on the metal rod realisticly. here's how i realized that goal. the ball has x and y velocities and positions. i position the ball 150 pixels above the origin. then, each frame i do the following. i check the distance between the origin and the ball. if the difference between the ball and the origin is more than the tolerance level (in my case it's 0.5 pixels). if it is, then i move the ball in the direction of the origin, by the the length of the rod minus the distance between the two points (the origin and the ball). i made a flash, that i hope would help you visualize what's happening here:
click here - you need at least flash 4 to see this
well, it seems to work and everything, and i do know that in game development if something looks right, it is right. but i'd still like to know the real way, and if my logic is right. i would also like it if someone would be kind enough to explaint to me how the forces would distribute to the origin, which is in this case immovable. but if i had another ball, on a metal rod, connected to the ball i have right now, how would the forces of the last 2nd ball affect the movement of the 1st ball, which is movable.
thank you very much for any help in advance!
---
shurcool
my project
[edited by - shurcool on June 19, 2002 3:37:12 PM]
Your physics.swf link is broken....doesn''t work...
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
thanks, i fixed it.
stupid brinkster wouldn''t allow access from other sites, it had to be from a page on brinkster.
---
shurcool
my project
stupid brinkster wouldn''t allow access from other sites, it had to be from a page on brinkster.
---
shurcool
my project
Don''t worry, I can help you 
For two masses connected by a light inextensible rod, the any force generated by the motion of one of those masses can only act on the other mass parallel to the rod connecting them.
So this problem is considerably simpler if you don''t want gravity. Do you want gravity?
Anyway, the solution goes something like this. You need a vector to store the positions and velocities of the objects. At each frame, you start by adjusting any velocities that need it (acceleration, and then remember that the velocity HAS to be perpendicular to the rod, but more about that later) translate each object by its velocity, and then adjust their positions (and velocities) to make sure that they end up the right distance apart.
George D. Filiotis
Are you in support of the ban of Dihydrogen Monoxide? You should be!

For two masses connected by a light inextensible rod, the any force generated by the motion of one of those masses can only act on the other mass parallel to the rod connecting them.
So this problem is considerably simpler if you don''t want gravity. Do you want gravity?
Anyway, the solution goes something like this. You need a vector to store the positions and velocities of the objects. At each frame, you start by adjusting any velocities that need it (acceleration, and then remember that the velocity HAS to be perpendicular to the rod, but more about that later) translate each object by its velocity, and then adjust their positions (and velocities) to make sure that they end up the right distance apart.

Are you in support of the ban of Dihydrogen Monoxide? You should be!
Geordi
George D. Filiotis
George D. Filiotis
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement