|
Author |
Topic: Elastic flocking (Read 1618 times) |
|
flight404
|
Elastic flocking
« on: Jun 15th, 2003, 12:29am » |
|
www.flight404.com/p5/bouncers8 spacebar toggles drawmode keys 1 - 5 set strokeWidth. (works best with 2 or 3) Basically, hundreds of line objects which flock towards the cursor when the mouse is pressed. When the mouse is not pressed, objects can be disturbed by fast mouse movements through the horizontal center line. When mouse is clicked and dragged, slow movements give the best results. When not clicked, fast movements work best. UPDATE------------------------------------ new version focuses on flocking behavior primarily. www.flight404.com/p5/bouncers9 UPDATE------------------------------------ More of the same. www.flight404.com/p5/bouncers11
|
« Last Edit: Jun 15th, 2003, 4:34am by flight404 » |
|
|
|
|
gkoshra
|
Re: Elastic flocking
« Reply #1 on: Jun 16th, 2003, 5:32pm » |
|
Bloody lovely. I'm looking forward to seeing more stuff from you. Is there any site/resource in particular that you reccomend for getting flocking info/formula stuff from? I'm really interested in natural movement.
|
|
|
|
flight404
|
Re: Elastic flocking
« Reply #2 on: Jun 16th, 2003, 6:52pm » |
|
Actually, gkoshra, I am not sure. My studies are not based on anything except experimentation. I didn't set out to reproduce flocking behaviour. I just happened upon a train of thought that found me near something flock-like, so I pushed in that direction. All you see here is a meandering object (invisible) which wanders around the screen (very poor meander code... tends to favor 45 degree angles... old code from the flight404.com days). I then place 500 to 1500 other objects whose sole purpose is to move towards the meandering object. There are random elasticity and friction variables so that they don't all move at the same pace. As an extra, I made the cursor a second meander point so that when you click and drag the cursor, the objects on screen will move towards it if it is within a certain predefined radius. From there, it was simply a matter of fudging different variables to see which effect was the most realistic to me. I think links off this site might lead towards a more scientific study of flocking. www.aridolan.com/JavaFloys.html
|
|
|
|
flight404
|
Re: Elastic flocking
« Reply #5 on: Jun 17th, 2003, 7:00am » |
|
Thanks for the links. Great material there. Here is my first stab. www.flight404.com/p5/steering2 'r' toggles the render information I was trying to simulate verbatim the wandering and flee algorithms at ... http://www.red3d.com/cwr/steer Getting there, but a lot of the vector stuff escapes me. Effect looks good when the enemy is in the middle of the screen. Haven't gotten around to dealing with the size boundaries. Going to work on the seek steering soon. Thanks again, folks, that was a great resource.
|
« Last Edit: Jun 17th, 2003, 8:37am by flight404 » |
|
|
|
|
gkoshra
|
Re: Elastic flocking
« Reply #6 on: Jun 17th, 2003, 8:59am » |
|
Excellent stuff to read and think about there. I suppose it's pretty easy to get hung up on phrases like 'flocking algorithms' and constantly push towards making things using that instead of starting off with a few more simple ideas then mucking about with them. Knowing about these things is very useful when experimenting though.
|
|
|
|
Dan
|
Re: Elastic flocking
« Reply #7 on: Jun 17th, 2003, 9:59am » |
|
Nice stuff! I remember flight404 from the old dreamless days - its cool to see you experimenting again. Here're a couple of implementations of floys I did a while ago: http://pupius.co.uk/stuff/experiments/floys/ (press l & o for extra info) http://pupius.co.uk/stuff/experiments/floys2/ The way the parameters are set up in the first one means that they don't group together so much, but rather resemble fish in a tank. The second one can be pretty slow on old machine, but shows pretty nice formations after a while.
|
|
|
|
REAS
|
Re: Elastic flocking
« Reply #8 on: Jun 18th, 2003, 10:54pm » |
|
flight404, you're making some excellent work, but what's up with your color selection? you're using color like a computer scientist.
|
|
|
|
flight404
|
Re: Elastic flocking
« Reply #9 on: Jun 19th, 2003, 12:06am » |
|
What? You want color??!!! I will give you color!!! TAKE THAT! www.flight404.com/p5/steering3
|
« Last Edit: Jun 19th, 2003, 6:34am by flight404 » |
|
|
|
|
gkoshra
|
Re: Elastic flocking
« Reply #10 on: Jun 19th, 2003, 8:48am » |
|
Gar! My eyes! My EYES!
|
|
|
|
REAS
|
Re: Elastic flocking
« Reply #11 on: Jun 19th, 2003, 2:28pm » |
|
exactly!
|
|
|
|
|