by Rob
Amos

Here's a quick example of how to use particles to create a field of
grass complete with a gentle wind blown effect. The file has two components:
the source geometry and the particle system. Note: If you're not familiar
with the sin() expression take a look at Anatomy of a Sine Wave Expression
in the Houdini User Guide before proceeding.
Set the Source and Particles
1.Open up the default Houdini
and rename one of the geo objects to grass. This is where the source
geometry will go. Delete the other geo.
2.Enter the grass SOP Editor and place a Grid SOP. Change the Orientation
Plane to ZX Plane. Leave the other parameters at the default.
3.Now switch to the POPs Editor.
4.Place a source generator POP. Make the Emission Type Points (ordered)
then make the source object grass and the source SOP grid1. This sets
the grid points to be the birth object; the grid should be visible in
the viewport. Under the Birth tab set the Const. Birth Rate to 3000.
Birth rate controls the number of particles born per second based on
a 30fps rate. Since the source grid has 100 points the result is one
particle born per frame per point. Set the Life Expectancy to 0.5 (seconds).
Then, under the Attributes tab, set the Initial Velocity to Set Initial
Velocity and give it a Y value of 0.5. Finally, make the Variance 0,
0, 0.

5.Playback the animation. The particles should grow straight up from
the grid points until frame 15 when the end particles die back at the
same rate as they are born.
6.The next step is to add some swaying movement. In order to do this
append a Force POP to the source and turn on its Display and Cook flags.
As an experiment enter a force of 2, 0, 0 and playback the simulation.
Remember the simulation needs to be reset to frame 1 to run correctly.
The grass bends but in a uniform and unnatural way.

7.Still in the Force POP, turn on Expressions and change the X force
from 2 to sin($F*5), then run the simulation. This time the motion is
a more natural sway but it's still uniform and artificial looking.

8.In order to add some variation you'll need to address each point.
Change the sine expression as follows: sin(($F*5) + ($PT*36)). The $PT
expression offsets the sine motion based on point numbers. Play back
the simulation. There's nothing magical about the number 36, or any
other numbers in this expression, so feel free to adjust them to taste.
For a final look try the following expression 0.5*sin(($F*5)+($PT*36))+0.25.
Add Geometry
9.The final step in the particle system is to add some geometry to the
particles for rendering. There are many ways to do this but the simplest
is to append a Render POP and make the Particle Type Render as Lines,
set the Particle Size to 0.01. Turn on the Render and Cook flags on
the Render POP. Your POP network should be as shown.

10.In order to output the particles you'll need to return to the grass
SOP Editor. Do this and start a new network by placing a POP SOP. Set
the Pop network to Popnet1 and Cook POP. Turn on the Render and Display
flags.

11.Return to the Object Editor. Adjust the camera to get a clear view
of the particles and render the result.
12.Some other things you could do; Append a Fractal SOP or Point SOP
to the grid to break up the grass rows, apply a material to the grass
object.
© Side Effects Software Inc., 1999