Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

CPeX

mass point of 2D polygone

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

can someone tell me where I can find formules to calculate the mass point coordinates of a 2D polygone. I think I can make them myself but if someone else has already done it I don''t want to do the work just over :-)

Share this post


Link to post
Share on other sites
Advertisement
ok that''s the formule for a polygone wiht 3 points.
But my problem is the calculation of the center of mass for a polygone with more points and I don''t think that
x= (x1+x2+x3+x4+x5+....+xn)/n is the right formule

Share this post


Link to post
Share on other sites
in physics u would have each point ortho to earth surface and draw a line from the point to earth, for all points the center of mass would be the intersection of all the lines.
hope this helps.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
no that formule can''t be right
ex:
0----0 0----0
| | | |
| | | |
0 | | |
| | | |
0----0 0----0
0 ==> point of polygone

have the same center of mass but with x = x1+x2+...+xn/n you get two different coordinates

Share this post


Link to post
Share on other sites
no that formule can''t be right
ex:
0----0 0----0
| | | |
| | | |
0 | | |
| | | |
0----0 0----0
0 ==> point of polygone

have the same center of mass but with x = x1+x2+...+xn/n you get two different coordinates

Share this post


Link to post
Share on other sites
wooops the figure is mixed up. but I think that you can guess how he had to look like.

Share this post


Link to post
Share on other sites
Break your polygon up into triangles. Compute the centre of mass of each triangle and it's area. Divide each triangles area by the total area of the polygon (sum of all triangle areas) and use this as the triangles weight. Take the average of each triangles centre of mass multiplied by its weight and that is the centre of mass of the polygon.

(I don't mean weight as in mass x acceleration, but rather as in 'a weighted average')

Timkin



[edited by - Timkin on March 20, 2002 9:06:00 PM]

Share this post


Link to post
Share on other sites
sounds to be the right solution and even very simple to program.
I''m just wondering why I didn''t found it myself :-) it''s very simple and logic. thanks

Share this post


Link to post
Share on other sites
what do you mean with 3D ?
a polygone in 3D ? ==> yes it will work
a object made of polygones ==> no it will not work

Share this post


Link to post
Share on other sites

  • 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!