I want to make a system of particles that move in a way that make them appear to inhale/exhale. In other words, have particles floating then slowing come together, then slowly spread out once again. Whats the easiest way I could do this? I have some circles already coded that slowly are moving back and forth but I am not sure how to make them move in the manner I would like. Here is what I have so far:
for (int i = 0; i < 800; i++) {
ofPoint point(ofMap(ofNoise(ofRandom(50) + ofGetFrameNum() * 0.00003), 0, 1, width * -0.5, width * 1.5),
ofMap(ofNoise(ofRandom(50) + ofGetFrameNum() * 0.00001), 0, 1, height * -0.5, height * 1.5));
float radius = ofRandom(1, 2);
ofColor circle_color;
circle_color.setHsb(0, 0, 300);
if (timer < 60) {
ofSetColor(255, 255, 255, 255 * ofGetElapsedTimef()/70);
ofDrawCircle(point, radius);
}
else {
ofPushMatrix();
ofFill();
ofSetColor(255, 255, 255);
ofDrawCircle(point, radius);
ofFill();
}