Symbolic Posted February 14, 2007 Share Posted February 14, 2007 Hi, I have really big troubles solving this Particle Behavior problem. I am trying to create mainly three different groups that will be performing different tasks. I think doing this with colors will be a good solution. So first I want to create a three groups. Group_1 will be the RED color. The guys who are in this group will stop (or move very slow), Group_2 will be BLUE, this is for the particles that will move slow. Group_3 is the GREEN group... they will be moving fast. It is obvious that there are some solutions for grouping. The problem is that I want to randomly cycle the points as memebers of this groups. Which means that a particle (ex: ID=4) will start as a RED member... then will become a GREEN member... then a RED member again... then maybe a BLUE member... I cuold not find a way of constantly regrouping my particles into different groups... so that they can fall into the posession of different forces... and so this will create a variable and jittery movement... Could you please help me about this. Thanks. Here is my file: on_the_wall_Behavior.hip Quote Link to comment Share on other sites More sharing options...
grasshopper Posted February 14, 2007 Share Posted February 14, 2007 Hi Symbolic, This is a really quick reply as I'm pretty busy right now. I may check out your hip layer if no-one else replies (I haven't looked yet). But my initial thoughts are that you are going about this the wrong way. Your colors are representing states that the flies can take. If these states are independent from each other (that is a fly is only ever in one of the red, green or blue groups in your method) then you only need a single attribute to hold this information. Put it in a color channel if you want or create a new attribute (my preference). Then you can have some kind of function that works on the partricles' ID. For example, a function like sturb($ID*0.02,$ID*0.03,$ID*0.04,0) willl be different for each particle because it is based on ID. Read up on noise functions to work out what expressions you need. Fit functions and clamp functions are also very useful. If you want to see what the functions do try putting one into a channel, then open the channel editor to see how it varies over a frame range. You can easily work out something that will give you more slow movers at the start of your sim but gradually increasing to more fast movers by the end. After saying all that I think what you are trying to do is overly complicated! Why not just have a single attribute which represents the speed a fly wants to go and use that as a factor in your forces? I bet you don't even need to group at all. Set the 'speedIntention' attribute to 0 when you want them to be stopped, a small value for slow movers and a high value for the fast movers. If you multiply your forces by this attribute then the forces will have no effect on the stopped group (because they are being multipled by 0) and a stronger effect on the particles with a high 'speedIntention'. Hope that makes sense. john Quote Link to comment Share on other sites More sharing options...
Symbolic Posted February 14, 2007 Author Share Posted February 14, 2007 Oh my god! I am just not that advanced in these Houdini particles. And I just do not understand it. I used $ID to randomize things like SPEED, MASS and the flies seem to be moving at different speeds. But this is not changing over time. I think I have to insert sin($F) somewhere. I just do not know... But this does not give me enough control... Here is my fast test: on_the_wall_XX7.hip May be I should just create three different emitters... group the created particles... And change thing like SPEED, MASS, CHARGE for each group. And another problem! They are going through each other... The interact POP uses CHARGE... but it just does not keep particles far enough... I do not know... I am loosing my energy and hope... I have been working on this single thing for three weeks... No result! Quote Link to comment Share on other sites More sharing options...
Symbolic Posted February 15, 2007 Author Share Posted February 15, 2007 Hey grasshopper thanks! I have used a simpler way than trying to organize the colors into attributes and groups... just as you suggested. I have used this in the COLOR POP: round(abs(sin($F*10*rand($ID)))) for R and round(abs(cos($F*10*rand($ID)))) for G This generates random per-particle values. Then: $COLOR_MOD=fit(($CR - $CG),-1,1,0.1,1) to calculate a color based modifier. I generated a speed modifier based on the color modifier: clamp(($ID), 0, 0.3)*($COLOR_MOD*10) then I used all of these to create a per-particle custom speed limit with the SPEED LIMIT POP. $CUSTOM_SPEEDLIMIT/10 So the RED particles have the ability to move and the GREENS do not. Also thanks to my teacher Phil He helped me with the color calculation thing. // Now how will I make those guys fly away?! I know that this speed_limit blocks everything. I tried to apply the technique to mass... and use a DRAG POP so the ones with bigger mass will be hard to be stoped and those with a small mass will get slower due to the DRAG POP... But it did not work... I do not why... a small test: color_flies.mov Quote Link to comment Share on other sites More sharing options...
grasshopper Posted February 16, 2007 Share Posted February 16, 2007 Hey Symbolic, I'm finding it hard to follow all your threads so wasn't sure where to post this(!!!). Maybe you could stick to just one thread to make it easier for everyone to follow! Anyway, you PM-ed me a few days ago to ask about making these beasties fly so here's one idea. To do a quick and dirty flying solution I split the task up into two sims - a walking stage and a flying stage. Splitting things into stages is always helpful to your workflow as you can get one part working and then 'lock it off' before moving on to the next stage. I didn't change the walking stage - it is the same as the one you mailed me. After that sim I added a flyTime attribute to say at what frame the flies should take off. I then only feed into the second sim the flies that are on the frame that they take off. The second sim simply creates one particle for every one fed in. It inherits the velocity it had from the corresponding frame in the original sim. I then added some forces in Z to make them take off. I added a bit of erratic fly-like motion with noisy forces but didn't spend any time on it. Feel free to make this look more how you like! Lastly there is some fixing of ID values (so they match the walkers) which you may need to be correct if you are instancing on to the particles later. After this I merge the fliers back with the walkers and you have two sims merged into one. As to your other question of stopping the flies interpenetrating. Just keep plugging away with the POPs that you are trying already but if one or two still interpenetrate that is far from a disaster. You don't have to keep re-running sims until it is 'perfect' as that can be extremely time-comsuming and counter-productive. Much better is to get it to a stage that is almost right and then you can simply delete one of each interpenetrating pair manually after generating your sim. Problem solved! Obviously you may have to birth slightly more flies than you need if you are going to end up killing off a few. The trick is to find the right balance. Good luck john. on_the_wall_XX13_jsh.hip Quote Link to comment Share on other sites More sharing options...
Symbolic Posted February 16, 2007 Author Share Posted February 16, 2007 Hi, I am really really sorry about the mess I caused. You are right, I should keep it in only one post. But I was so desperate that I just ended up posting part of the same problem into different topics. In the future... I will keep this in mind and will be more careful. About the solutions: It sounds a like a great solution... Thank you very much. I hope that I will be able to finalize this thing with all these new tips. Especially, the one about "saving the simulation" and killing those particles that go through each other... I would have never thought about it... Thanks alot. I will look at the file you uploaded and I will try to finilze this specific problem today. Thanks to everybody helping me about this project... Especially to you grasshopper and Marc... and others... Hammy, Ymek, stevenong (sorry if I am forgetting somebody) Again, I am very sorry for causing that topic-mess. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.