add a turbulence feild in popnet (please help me)

   8557   1   1
User Avatar
Member
19 posts
Joined: July 2005
Offline
I am new in houdini ,i want add a turbulence feild(like maya) to a popnet
particle ,but i can't find turbulence feild in force,anyone can help me ,thank you very much.
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Turbulence is provided in quite a few POPs. I will list them in a bit but what I think you are getting at is to define a specific volume in space where turbulent forces would be applied. Turbulence is a special case of noise which is usually abs(noise) or the absolute value of a noise generator. Where the noise folds over at 0 creates very nice effects that looks very much like puffy clouds.

To apply turbulent noise in a specific volume, you need to use groups based on bounding volumes. The group POP can use a default sphere or box to group particles. You can also specify an actual object/sop to define the volume. Once you create the group, you then use this group in the group field of the following POPs that have Noise folders:

Force POP
Wind POP
Fan POP ( can use object as fan centre and orientation )
Attractor POP
Resistance POP (actually has a turbulence folder instead of noise folder)

There may be more as this is just off the top of my head.


You can quit here and start experimenting but I like to be complete and cover expressons as well. Remember I warned you! :wink:

Great, but this just scratches the surface! There are expressions that you can use to generate noise() and turbulence() built in to Houdini that you can use anywhere there are local variables available. This is the power user approach but it truly is very accessible even to the novice user.

Try the following exercise. First create a real simple pop particle system and make absolutely sure that the source POP is birthing particles with absolutely no initial velocity. They are just being born right on the surface.
Now let's motivate these particles absolutely with a position POP using their position accessed by $TX, $TY and $TZ plus $LIFE to add some time to the equation where $LIFE is a two component vector where $LIFE is the current age and $LIFE is the total life expectancy of the particle in seconds.

So, after the Source POP, put down a Position POP. In the position POP's translate fields, put the following expressions:


$TX + 0.1*(turb($TX*10+10.1 + $AGE, $TY*10+10.1, $TZ*10+10.1, 12))
$TY + 0.1*(turb($TX*10+100.1, $TY*10+100.1+ $AGE, $TZ*10+100.1, 12))
$TZ + 0.1*(turb($TX*10+1000.1, $TY*10+1000.1, $TZ*10+1000.1+ $AGE, 12))


Play forward and the particles move using turbulence, pure turbulence. Nothing else. No forces. Now you can use this function in any parameter in any POP. You can put turbulence where ever you feel like it!

Phew. Now to explain. $TX $TY and $TZ represent the individual position of each point/particle entering the Position POP (or any POP for that matter). You can open the spreadhseet and for each point number, there is a respective x y and z position. Each one of these values in turn is stuffed in the turbulence() function to determine the current position for each point. In essence, the position POP is turned in to a for loop function where the turbulence() cycles through each point.

Next is the turbulence() function itself. It's formal code representation is:

float turb (float X, float Y, float Z, float depth)

float turb means that this function will return a floating point value in to the parameter field. Inside the function takes four floats. The first three are the position in X, Y and Z to sample the turbulence noise in space in houdini units. Wether this is world space or object space depends up to you and how you bring the geometry in to the Pop SOP.

The last float depth is the number of times the noise is looped through the internal function. In a general turbulence function, the position and value of the noise is scaled down by a factor of 2. This is what adds those nice little whisps of fractal noise. There are quite a few books on this fyi.

Finally let's look at what I used for the X, Y and Z positions inside the turb() function.

$TX*10+10.1 for the X turb position>>>

This means that to sample or find the value of the turbulent noise function in the X position and use the current particle's position ($TX) times 10 (which means you are sampling an area 10x larger than the current particle's position) then add any offset “seed” value to ensure that it is different for the Y and Z fields in the subsequent two turb() expressions.

Now I just, on a whim, decided to put the +$AGE local variable in the X for X, the Y for Y and the Z for Z. Why? You need a time component to move things along. $AGE is the current age for each particle in question. This is quite common to do. Some use $F (current frame) $T (current time in seconds) but I like the per particle uniqueness of $LIFE or $AGE to add the time component.

I can keep on going for hours but I will cut it off for now as this can be overwhealming. There are VOPs for even more control for example.

If you want to explore this further, open the textport and type in exhelp turb to get a bit better explanation of the turb function. While you are at it, look at noise() snoise() and sturb(). There are also may more default local variables available in POPs including the most important one $ID which ensures that each particle has a unique number that will not be recycled as point numbers are.


-jeff
There's at least one school like the old school!
  • Quick Links