Page 47 - 3D World - October 2017
P. 47
TuTorials
Grow procedural plants in Houdini
understand
signed Distance
fields
Use SDFs to work with
the properties of your
geometry. An SDFs’
value is the distance
to your mesh’s surface,
its gradient, its normal.
Handy to generate
flows and directions.
pRepARe AttRibutes climbing plAnts
06 Before using Copy Stamp, some attributes need 07For the climbing plants, we need to write our own
preparation. In VEX use a random number to drive a ramp solver in VEX to mimic a growth mechanism. It might
of a random number. This is a visual way to control scale sound daunting, but we go step by step all the way. Don’t
distribution. In the same way, set the colour to a random forget to also use the Houdini Reference on VEX. To find
green. To make the strands point in slightly different the root points we go with the same mechanism we used
directions, change the normal by adding a random offset on the grass. Start off with a few points on the ground,
in X and Z direction. Voila, you grew grass! close to the wall.
plAnt foRces gRow the seeDling
08 We have three forces at work. The first we’ll call UP, 09Now comes the time for us to dive into VEX using a point wrangle. In a
pointing away from the ground against the gravitational for loop we grow the seedling in short segments by adding to the variable pos,
pull. The second is a vector named WANDER, pointing which has been initialised with the start position. For now, only grow along the
in a random direction along the wall. The third force is UP vector.
called WALL, pointing towards the closest obstacle. This It’s good practice to make use of the ch() and chv() functions, to expose
emulates the plant’s desire to climb. We will use all three parameters to the interface. You then can easily experiment with the result of
forces on each growth iteration. the algorithm by interactively changing those values.
nAtuRAl effects
10 For a more natural look,
add the WANDER force. On
each step calculate a random
direction based on a noise
function. This random vector
adds to the direction the
seed gets moved. For better
balancing, also introduce
two weighting factors to
the interface, scaling our
forces up or down. The result
is vines growing with a lot
more variation, but they now
penetrate obstacles they
meet. To avoid this, the third
type of force comes in handy,
the WALL direction.
3D WorlD October 2017 47 www.youtube.com/3dworld