Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

Toxiclibs - creating particles that connect to eachother using springs within certain distance

$
0
0

Hi there!

I've been working through examples and any tutorials I can find and still can't wrap my head around how I can do what I'd like to do. I'm pretty new to processing.

Aim: I want to make 300 slowly floating particles inside my bounding box/sketch that connect to eachother via a spring when they float within a certain distance of one another. It would achieve a similar affect to this: https://vimeo.com/73233807

I'm not sure how to: 1) add 300 particles to my sketch to start with. I'd like to make a Particle class and then call that class 300 times. Does that make sense? How do I do this? Do I need to use arrays or arraylists?

2) Make a string connect between 2 particles when they come within say - a 20 pixel radius of one another. Like the video I've linked, I'd like that string to become a permanent flexible connection and for particles to have multiple strings between one another.

Sorry if this doesn't make great sense - I appreciate any help I can get. Thank you!


Viewing all articles
Browse latest Browse all 2896

Trending Articles