3D Particle Waveform (Composition by dust)
Author: | dust |
License: |
MIT
|
Date: | 2010.10.18 |
Compatibility: |
10.6 |
Categories: | |
Required plugins: |
(none) |
this patch generates 3d particles from the waveform of kineme audio tools.
inspiration and credit goes to t-link....
|
so yeah this is just something i came up with today while matthais and i where trying to convert boids pseudo code to cl, which is now successfully working like it should. so this is a bi product of sorts i'm sharing. blah blah....
;)
Hi Dustin
boids in cl......cool - don't suppose you would be happy to share it? I've been asked to take a high school class through the boids algorithm and this would be an excellent start
even if your not keen to share it could you post some videos please?
Cheers James
Would love to see that boids OpenCL code too! I started putting together some boids scripts in JS, but got sidetracked (as is so often the case). and never finished it. Makes much more sense to do it in CL though.
a|x
Nicely turned out indeed, dust.
I'd be interested in seeing a boids openCL implementation, especially depending on what rules it actually implements.
I may as well post here; been looking at this - a pretty good breakdown in pseudocode.
http://www.vergenet.net/~conrad/boids/pseudocode.html
Almost makes me feel like I could do it with built in patches >)
so this is a 3 rule boid kernel. it seems a gl point patch is rendering the flock more correctly. not really sure whats going on with the mesh creator.
next is to make them stay on the screen etc... mouse xy is the perceived center of the boids which they flock to etc...
its not pretty yet but any help pushing this along would be awesome.
so i posted the rudimentary code. the pseudo code that GT linked might be easier than explaining CL.
i get it CL but its weird and i'm defiantly not on a level to really explain something like this.
matthais helps with some high school he might be better at explaining but to tell you the truth we where both stumped for a while.
any ways if you where to explain the meat of the algorithm is this.
Cheers - I'll have a play around and repost and modifications
Dust and I are still working on it.
If you guys are interested we can share the boid code, once it is a little more cleaned up
@ties i got this running all in cl now. its pretty smooth but i can only push 24,000 particles using a gaussian gradient for particle textures. I have them flocking to the mouse and added some feedback trails. I can do about 100,000 with a particle size of 6 px with no texture. hit me up on skype and i can send you this new version or vise versa and we can see how many more particle you can push. still thinking about how we can do real trails. now that i got it outputting to a mesh we can add filters or what ever.
The one screen cap shows some collision going on at boundaries...that's pretty cool. This will be interesting to see develop.
You can do real trails by queueing past particle positions and rendering to mesh, line or quad. You may need to sort your structure by some kind of value that would denote time of particle, like if you particles do a color change over time (thanks smokris).
If the screen caps are definable as boids, then I happened to have posted a node based boid implementation a few minutes ago to the repository.
yes just saw your post nice one. like its all noodles. i can send you the code for this my skype is ter.maximus.
the code is on the net just not in qc yet. the first 3 rules where taken from the pseudo code you linked and then added some more behavioral stuff from this guys c++ code. http://www.behaviorworks.com/people/ckline/
also added is repulsion, repulsion step, velocity limiter, velocity match force, and center of mass force parameters as well as some others.
edit
i answered your question GT but it seems you edited out the question form the post.... so others can follow along george asked about the difference between boids and flocks and if this is flock or boid when avoidance rules are added.
end edit
to answer your question in part this video shows the boids algorithm. what matthais posted is the classic boid. once you add a mouse then your kind of changing it a bit.
seeing the boids flock to the center of the boids as a whole as well as flock to the center of them selfs until they hit and find the new center. so in theory they kind of wander around unless you limit to screen boundaries.
i added the mouse to the perceived (average) center of the flock so it kind of changes how the boids flock a bit by not being an average center of the group but where ever i put the mouse but the three basic rules still apply.
the rules applied in the simplest Boids world are as follows:
separation: steer to avoid crowding local flockmates
alignment: steer towards the average heading of local flockmates
cohesion: steer to move toward the average position (center of mass) of local flockmates
more complex rules can be added, such as obstacle avoidance and goal seeking etc..
flocking in unity is really cool because of the physics engine. it lets you simply add a collision sphere around a model making somethings simpler in code.
to do the collision is cl you use a distance function.
as per the amount of particles and the speed i am getting my number from t-linked. he has a particle patch that he says is 100 thousand particles and im doing half the amount his patch is. he must have made a typo cause his grid is only 100 x 100 which makes 10,000. just tried to re confirm but his site is down at the moment. maybe he is fixing a typo or i read his blog wrong.
;)
yes! I've been hoping for someone smarter than me to implement boids on qc for so long now! massive props to dust and matthias!
I guess the reason I edited my post is because the sample screen cap seemed a bit chaotic, and I didn't see what I expect... it looked more like a QC particle system following a mouse, instead of a more nuanced movement with physics properties. Matthias's screen cap seemed a little more like what I would expect... since it's still in the works, I edited that aspect of questioning out of my post.
I'm looking forward to seeing how this ends up!
respect goto... this is sort of the first small step to a much larger installation. when the boids part is finalized one of us will post the source, only seems fit to put it back on the net as thats where it came from.
When you get your OpenCL boid code going, it would be interesting to add in some stuff to shape the flow like I have going in this screen cap. If you have a "flow" of vertices going, it will push them into the paths that you wish.
Man, I went all day and totally forgot about the Skype. I'm not a habitual video-chat guy... more like, write a letter on paper, give it to a pigeon. I'm an old-school holdout at heart.
i watched this a few hours ago... most defiantly once the boids are wandering the plan is to use pixelS based motion detection to shape the flock. actually you don't really see this in action but the boid file i posted here has a convenient macro made for this sort of thing; orginally by shaping the snow particle dev example. i have since abandoned that example but yes that is the idea.
no worries GT your in my gmail i will send you a link. just suggested skype as i use that for a telephone and its always open. i don't use the video feature really. i screen cast sometimes don't really know many people that like to video phone i have a few friends that sometimes chat with me over skype video but normally just my uncle in california calls me on it. talked with lee a couple times over skype. he is big into video chat and what not.
i'm really a loser i just signed up for another gmail account so i can star-trek i mean face-time with my self now that face-time works on my laptop. seriously i'm face-timming my self right now with my ipod and laptop.
but yeah so yeah my face time or email is dustin.oconnor@gmail.com or oconnor.dust@gmail.com im really bad at returning emails and what not so probably better i send to you.
i see you on gtalk sometimes but never for more than a min. or two. i only notice because your the only person that ever shows up on my list. i don't know how you got there must have answered a qc dev question of yours ?
Here's a tip; forget about pixelS and use OpenCL for that part. If you think about it, the OpenCL example that demonstrates text extrusion shows you how to return the color structure of an image, and it has the benefit of giving you vec4's off top.
Usually, I leave my gmail chat set to "away" but I flipped it on the other day, so you've probably seen me. I doubt it's because I was asking you any questions (no offense, I just never use it), it's probably just because of QC dev list emails. If you show up in someone's emails enough, they get pushed to the chat column if they also have gmail.
no the pixelS plugin has been remade in CL is what i was trying to say or well a monochrome version. that make sense about the qc list populating my g mail thing. i was thinking it was because i must have answered a dev list question that had your email reply to it a few years ago as i seem to be on a moderated list right now so it has been sometime sense i have been able to participate on that list. but i read the threads. i guess i don't really have many questions anymore so it doesn't bother me not being able to reply to things.