Yesterday I posted a question about simulating gravity and the reply seemed to be ‘use particle candy’. I haven’t shelled out for it yet, but I wanted to understand at least a rudimentary model for the physics of the thing, so I wrote a couple of sample apps this morning implementing (by accident) elastic rope (inadvertently the opposite of gravity) and gravity/magnetism. I’m not sure what the distinguishing features would be between gravity and magnetism, but the effect is fairly convincing (I think) for such a small piece of code. If anyone can best me please do - I’d love to see it done with ‘proper’ maths (mine is rubbish, so I make do with what I got)…
Elastic: https://files.me.com/horacebury/h0ml2y
Gravity or Magnetism (what do you think?): https://files.me.com/horacebury/lc0icb
And, if anyone’s interested, here’s a dl of the drawable, draggable circles I did for another post: https://files.me.com/horacebury/xt3q1g
Have fun and let me know what you’ve got (I love feedback, especially constructive/educational)…
Matt. [import]uid: 8271 topic_id: 4331 reply_id: 304331[/import]
