← Learn library

Houdini & Procedural Workflows / Houdini

How to Make a Picket Fence in 3D | Houdini Tutorial

Channel: CGI Nerd ·

Written guide

Original CGI Nerd video thumbnail
How to Make a Picket Fence in 3D | Houdini TutorialCGI Nerd · Video hosted on YouTube

Playing loads YouTube content. YouTube processes data after activation.

Watch on YouTube

If the player is blocked or unavailable, use Watch on YouTube.

Software: Houdini

A procedural fence is useful when an environment needs many variations of the same construction. This lesson builds a picket, distributes copies along a line, adds two support rails, and exposes controls for shape, irregularity, and curvature. It then packages the network as a Houdini Digital Asset and creates fresh instances from that definition.

The important result is a set of working relationships: taller boards remain on the ground, rails follow the fence length, and changing the board count also changes the rail divisions needed for bending. The recording uses the historical Copy Stamp workflow. Its exact Houdini release is unverified; the parameter interface and asset creation steps should be understood in that context.

Build the interface alongside the first board

At 01:33, create a Geometry object and name it for the fence. In Edit Parameter Interface, the instructor temporarily makes the existing Transform, Render, and Miscellaneous folders invisible. This clears space for construction controls without deleting the original settings. Split the parameter pane into two views and pin one to the outer fence object. The other can then follow nodes inside the network while the asset controls remain accessible.

Start the picket with a Box: the demonstrated dimensions are 1 along X, 5 along Y, and 0.3 along Z. X is board width, Y is height, and Z is thickness. Create a Create Fence folder on the outer object and add floating-point Board Height and Board Width parameters. The internal parameter name is the identifier used by Houdini; the label is the readable interface text.

These controls initially do nothing. Copy the outer height parameter and use Paste Relative Reference in the Box’s Y size. Repeat for width and X size. Pasting a value would copy only the current number; a relative reference makes the internal size respond to later changes outside the network. Set the height default to 5 and width default to 1.

The negative-height experiment around 09:03 shows why a slider range alone is insufficient protection. Lock the low bound to prevent a negative dimension. The demonstration permits zero, while mentioning 0.1 as a possible alternative. Zero can still collapse geometry, so the example is a basic interface constraint rather than a complete validation system for every combination of inputs.

Change the Box to Polygon Mesh and keep its Z divisions at 2. To place the board on the ground, reference its Y size in its Y center and multiply that reference by 0.5. Because a centered box extends half its height below its center, moving the center up by half the height puts the bottom at the origin. Change height again to verify that the base stays on the grid.

Make the peak a controlled deformation

Beginning around 12:35, create a group for the part of the board that will form the peak. The recording selects a face identified as 19 in this particular Box topology, names the group, and restricts a Transform to it. That face number belongs to the demonstrated mesh; it is not a universal picket selection for any box subdivision.

The group name matters independently of the node’s descriptive name. When the instructor renames the group, the Transform’s old group1 reference becomes invalid and is replaced with the new group name. Without the restriction, the Transform moves the entire board instead of shaping its top.

Expose a Board Peak Height float and paste a relative reference into the Transform’s Y translation. Test zero, positive, and slightly negative values. The example leaves negative values available because the observed shape remains usable, although the instructor questions whether that shape would be desirable. This is a useful distinction when designing an asset: a parameter can produce an unusual artistic choice without necessarily being a broken connection.

Distribute boards and separate tilt amount from seed

From 17:31, create a Line extending along X, with an example length of 10. Connect the shaped board to the geometry input of Copy Stamp and the line to its template input. Two line points produce two boards; increasing the point count produces more boards along the same span.

Expose Number of Boards and connect it to the line’s point count. The instructor first creates a float, then corrects it to an integer around 24:03. Keep a minimum of 2. A whole-number control communicates the actual operation and avoids offering fractional board counts. The display maximum of 10 remains unlocked so larger counts can be entered.

The tilt experiment uses Z rotation, with cumulative transformation disabled. It feeds point-number-based randomness into fit01 to map the random result into a rotation range. The initial range of −45 to 45 degrees is deliberately exaggerated to make the variation visible; it is not the recommended finished appearance.

Two exposed controls then replace the fixed settings:

  • Board Random Tilt determines the magnitude. Its reference supplies one range endpoint; the negated reference supplies the other.
  • Board Random Tilt Seed changes the input to the random function. In this construction the point-number input is multiplied by the seed reference.

At zero tilt, all copies should return to an upright appearance. At a nonzero tilt, changing the seed should change the arrangement while leaving the permitted rotation range controlled by the tilt amount. A zero seed collapses the multiplied inputs to the same value, which the instructor explicitly notices. One board also remains unchanged in the demonstration; the suggested explanation about the base copy is tentative. Do not treat this as a thoroughly resolved guarantee that every board varies independently.

The narration establishes the expression’s functions and inputs, but not every exact channel path. Build the references from your own parameters instead of copying an invented expression with assumed node names.

Derive support rails from the existing dimensions

Save the scene, then create another Box for a horizontal support around 30:00. Merge the support with the copied pickets for inspection. Its Y size is linked to board width, its X size to the line length, and its thickness is set to 0.3 in the example. These choices make the rail span the same fence as the distributed boards.

Place its X center at half its X size. This matches a line running from the origin along positive X instead of leaving half the rail on the other side of the origin. For the example’s equal board and rail thicknesses, the negative Z offset derived from the rail thickness moves it behind the pickets. If thickness relationships are changed later, inspect the contact rather than assuming that this simple offset handles every case.

Feed the rail into two Transform branches and merge both results. Put the lower rail at an example Y offset of 1. Put the upper rail at board height minus 1. The upper rail now follows height changes while retaining the same inset from the top that the lower rail has from the bottom.

Expose Support Board Spacing and add its reference to the lower rail’s offset while subtracting it from the upper rail’s offset. Increasing it moves the rails toward each other. Test this at more than one board height: a working channel connection does not guarantee that an extreme spacing value will still produce a sensible fence.

Rotate the rails around their centers

The support tilt work around 41:04 first reveals a pivot issue. A long rail rotating about the origin swings differently from a rail rotating around its midpoint. In each rail Transform, reference half the rail’s X size into the pivot’s X position, then inspect the Z rotation again.

Expose a support tilt magnitude and a support seed. The rail rotations use the same random-to-range idea as the pickets, but the two rail branches need different random inputs. The finished demonstration uses different added constants, 5 and 3, so changing the common seed does not give both rails the same rotation.

There is a significant setup mistake here: a relative reference is pasted into the wrong place during the seed work. Attempts to clear the channel do not produce the intended result, and the instructor removes and rebuilds the affected interface parameter. The useful recovery check is to inspect which field contains the reference before continuing. A size parameter that unexpectedly contains a rotation-related expression is a connection error, not a reason to compensate elsewhere in the geometry.

After repair, test seed and magnitude separately. The seed should select a different pair of angles; magnitude should make those angles more or less pronounced. Verify both rail pivots before evaluating the appearance of the randomization.

Give the bend enough geometry to work

Add a Bend after the assembled fence around 50:01. Its initial orientation and capture region do not fit the model. The instructor changes the up vector to Z, adjusts the capture direction to run along the fence, and references the line length into the capture length. The spoken axis wording for the capture direction is incomplete, so use the visible capture region to confirm that it covers the fence from end to end.

Even with the capture region corrected, the rails do not curve as intended because their original topology lacks divisions along the span. Change the rail Box to Polygon Mesh and increase divisions along X. More divisions give the Bend more intermediate positions to deform.

The lesson then makes a more specific design choice: link the rail’s X divisions to Number of Boards. The observed edges align with the board positions, leaving straight sections of rail between neighboring pickets. This produces an articulated fence appearance instead of adding excessive subdivisions solely to create a mathematically smooth curve. Recheck both low and high board counts.

Expose Bend Fence with a displayed range of −90 to 90 and a default of zero. The range remains unlocked. A temporary refresh issue occurs after connecting the control; navigating away and back restores the update in this scene. That is an observed workaround, not proof that every apparent Bend failure is a viewport glitch. Check capture direction, capture length, and topology first.

Package and test a fresh asset instance

From 57:02, return to a straightforward default fence, with randomness removed and the peak reset. Restore visibility of the original object folders. Organize custom controls into simple groups for board shape, support settings, and fence attributes, nested inside Create Fence. The instructor corrects misplaced controls while arranging these folders; confirm that each control remains inside the intended parent folder after applying changes.

At 64:02, use Create Digital Asset on the outer fence object, choose an operator name and asset file location, and accept the definition. The recording then deletes the scene instance and creates a fresh fence from the Tab menu. Its defaults and controls are still available, including board count, peak, tilt, and bend. A second instance can be positioned and varied separately.

That fresh-instance check is stronger than inspecting only the original construction network: it demonstrates that the packaged definition can recreate the tool. The lesson stops at this introductory HDA result. It does not establish distribution to another workstation, Houdini Engine integration, material authoring, or exhaustive validation of extreme parameter combinations. For following the recording, the practical acceptance check is that a newly created fence retains its interface and that each exposed control changes the intended part without breaking the dimensional relationships built earlier.