We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Particle Magnet
Page Index Toggle Pages: 1
Particle Magnet (Read 601 times)
Particle Magnet
Dec 23rd, 2008, 12:33am
 
Hi,

I've just started with processing and am currently trying to create a simple particle magnet whereby a number of particles are given a positive charge and the mouse has a negative charge. The particles should then be attracted to the mouse position.

I've been reading http://processing.org/discourse/yabb/YaBB.cgi?board=Contribution_Simlation;action=display;num=1082567431;start= ... However, my maths isn't brilliant and I don't quite understand what miked is saying about all the equations.

In my particle class, should I be storing the energy of every other particle, or only the energy of the current instance?

I'm really just trying to get something very simple working, so if anybody can explain how this should work in layman's terms that would be great.
Re: Particle Magnet
Reply #1 - Dec 27th, 2008, 7:05am
 
harry,

use the physics library. its all done for you pretty much. you can find it in the Libraries section of this site.

also, prof. shiffmans nature of code website has some nice paragraphs on vectors, particle systems, etc.

-0.
Page Index Toggle Pages: 1