Tutorials

By Jeff Mottle

Chain Link Fences and Slicing Planes

Editor's notes

Article brought to you by Ted Boardman
Jeff Mottle — Founder at CGarchitect

Chain Link Fences and Slicing Planes

Ted Boardman tedb@tbmax.com         http://www.tbmax.com


I’ve been installing some new software and some new hardware this month, but I’m not even entertaining thoughts of installing my air conditioner in the office. July along the New Hampshire coast has remained cool due to the wind off the ocean that hovers around 60 degrees F at the surface and 40 degrees in the deeper water. I’m getting limited time on my porch after work and weekends even wearing a long-sleeved flannel shirt, and we’re on the steep downside of summer. Global warming seems to have missed the coast here.

It’s off to Los Angeles for Siggraph from 8-13 August where I’ll be teaching a couple of the Discreet master classes, one on lofting and the other on materials. Follow the link on my website for details and a schedule for all the classes. Stop me and say hi If you see me wandering around the show floor, or wandering anywhere for that matter. I’m sure I’ll see some of you at the CGarchitect event, too.

For those of you on the other side of the Atlantic, I’ll be teaching three one-day seminars in November hosted by Joep van der Steen of 3dstudio.nl. Follow the link on my website for the details on dates and enrollment for Apeldoorn and Barendrecht, Netherlands and Merksem, Belgium. There are only a few seats left, as the classes are intentionally small, limited to six in a class.

In this column I’ll cover chain link fences and slicing objects at a given plane.

Chain Link Fence

A topic that I’ve seen several times in the various forums recently is constructing a chain link fence. For those of you who’s native language is not US English you may not be familiar with the term, but I’m sure type of fence is widespread. It is a diamond pattern net of twisted heavy wire, usually used as a light security fence. A Google search of “chain link” will produce examples of the real thing.

While lofting and arraying a small piece of the wire could be used to create the fencing, the mesh would quickly become non-productive because of the density. So, as usual with my examples, optimization and editing flexibility are important issues. Unless you are actually selling chain link fence with your scene there is probably no need for high detail, as you probably wouldn’t see the fence from a particularly close distance.

I’m going to show two methods here that you can use as starting points, one (Landscape_Max6_mapped.max) is a Material and map example that is very efficient and looks reasonably good from a distance. The other method (Landscape_Max6_modeled.max) is a modeled fence that certainly has more faces but will allow fairly close viewpoints and still be convincing. The techniques will work in previous versions of max and VIZ, also. Opening these max 6 files in VIZ 2005 will produce an error message because of a grass object that was created with Particle Flow in max 6. You should still be able to open the scene.

The basic model is a max 6 file. It began with a QuadPatch grid converted to Editable Patch. Vertices were moved and the Bezier handles adjusted to create the illusion of sand dunes.

A line was created to represent the fence line and a Normalize Spline modifier was applied to add more vertices for the next step. An Object Space Patch Deform modifier was applied to the line causing it to deform to fit the landscape surface. It is important to use Object Space Patch Deform instead of World Space Patch Deform so the line may be used later to actually deform the fence itself with a Path Deform modifier.

Note: the free plug-in called Glue from itoosoft.com could probably be used to deform the line to the Patch surface and would definitely work if the landscape were a mesh object.

I won’t set these up as step-by-step tutorials, but I’ll walk you through the basic process and you can use the methods to develop your own scenes, opening the files as reference. There are landscape materials and sky materials that you may find interesting, as well.

Mapped Chain Link Fence

The modeling for the fence in this mapped chain link example is very simple. I create a Plane primitive the size of the fence I wanted and set the Length Segments to 1 and the Width Segments to 6 so it would be efficient but still conform to the landscape. See Figure 1.

Figure 1: The fence is a Plane with enough segments to deform to the shape on the landscape.

I applied a material to the fence called Chain Link that is a Tiles map in both the Diffuse Color and the Opacity slot. The Tiles map uses default settings except for a Gap setting of 0.7 and a Blur setting of 0.5. The material is also set to be 2-Sided so the fence is visible on both sides.

I applied a UVW Map modifier and changed the Length and Width to 1’0” for a 3” mesh. At sub-object Gizmo I rotated the map 45 degrees.

I then applied a World Space Path Deform modifier to the Plane and picked the fence line as the path and clicked Move to Path. Adjusting the axis, the rotation, and the percentage placed the fence in position.

The fence posts were placed along the fence line with the Spacing Tool.

Figure 2 shows the resulting fence rendered and casting shadows on the ground. A simple example, perhaps, but one that you should be able to easily adapt to your specific needs that is fast and efficient.

Figure 2: A chain link fence created with a Tiles map in the Diffuse Color and Opacity slots.

Modeled Chain Link Fence

This fence will have more detail and will hold up to closer scrutiny by the viewers, but is also considerably less efficient. The basic object is a Plane with the actual fence cut with the ShapeMerge command.

You will apply a Lattice modifier to the mesh to create the actual fence geometry. Lattice creates struts where there are visible lines in the mesh object, i.e. the segments of the Plane.

But first the mesh; I created a large, square Plane, set the segments for a 3” spacing and rotated 45 degrees in the Top viewport. I then created a rectangle the actual size of the fence and positioned it below and centered on the plane. See Figure 3.

Figure 3: A large square Plane rotated 45 degrees with a rectangle the size of the fence.

I selected the Plane, went to Compound Objects, ShapeMerge and picked the rectangle to cut new edges into the Plane. I then checked Cookie Cutter and Invert to be left with a diamond pattern mesh. See Figure 4. Be patient, even on a fast machine this process could take a while to calculate.

Figure 4: Use ShapeMerge to cut the rectangle into the mesh and choose Cookie Cutter and Invert to leave just the fence portion.

Immediately right-click on the mesh and use Convert to Editable Mesh to free up the overhead of the ShapeMerge calculations.

Go into Hierarchy panel, Affect Pivot Only and use the Align tool to position the Pivot Point to the bottom center of the fence because it’s the pivot that will attach itself to the path.

Go to Utilities panel, Reset Xform, and choose Reset Selected to re-orient the pivot from the rotated orientation and then convert to Editable Mesh again to “bake” that orientation in.

Now, apply a Path Deform (WSM) modifier and choose the fence line shape in the Camera01 viewport. Click the Move to Path button and set the adjustments similar to Figure 5 to cause position the fence on the path.

Figure 5: With Path Deform (WSM) modifier you can deform the fence to the path.

Apply a Lattice modifier to the Plane, check Struts Only from Edges and set the Radius for the struts to 1/8”

Rendering this object might take a very long time because of the shadow casting on so much geometry so it would be wise at this point to right-click on the fence and go to Properties to turn of Cast Shadows.

To free more resources for max, you can go to Tools pull-down menu and use Snapshot to make an Editable Mesh clone of the fence. Then delete the original Plane01 and trim the new Plane02 at the end fence posts. You cannot collapse the Modifier Stack because a World Space modifier is always above the Object Space modifiers can’t be collapsed with the regular commands.

Caution: make sure you have finished editing the fence before you delete the original because you won’t be able to adjust the Snapshot clone.

A Little Something Else

I haven’t used Snapshot on this file so you can see the effects and settings of the modifiers. The rendered image in Figure 6 shows the fence running through grassy hills. But the grass is an exercise for some later time.

Figure 6: Turn off Cast Shadows property for the fence and unhide the grass Mesher01 object in the scene.

Slicing Objects on a Plane

Someone asked me a while ago how to slice a dormer at the roof plane. Usually, just passing the dormer into the roof is sufficient to get a rendered intersection that looks fine, but there are certainly times when it would be handy to slice an object to fit on the surface.

The method I came up with doesn’t make any sense to me. That is, I can’t figure out what’s happening, but it does seem to work in many cases so it’s worth a try if you need this functionality.

I’ll use a simple example, again done in 3ds max 6, but it should work in other versions. It will use the Slice modifier and two alignment tools, Normal Align and Align. You must also set the Reference Coordinate System to Local.

If you open the file called Slice on a surface.max you will see a dormer positioned in a roof. Select the Dormer and apply a Slice modifier.

In the Modifier stack, go to sub-object Slice Plane. In the main toolbar, click and hold on the Align button and choose Normal Align from the flyouts. In the Perspective viewport, click and hold on the front of the dormer and move your mouse to see the blue normal arrow. Release, and click and hold on the roof plane to see the green normal arrow. See Figure 7. Release and click OK in the dialog. This aligns the Slice Plane so it is parallel to the roof plane.

Figure 7: While in sub-object Slice Plane mode, use Normal Align to align the slice plane parallel to the roof plane.

Switch from View to Local Reference Coordinate System in the main toolbar. Click the Align button in the flyouts and pick the Roof in the Perspective viewport. Check the Z Position and choose Minimum in the Target Object column. See Figure 8. Click OK.

Figure 8: Aligning to the Local axis Z Position Minimum setting sets the Slice Plane on the roof surface.

In the Slice Parameters rollout of the Modifier Stack, choose Remove Top and the portion of the dormer inside the roof will be sliced away. Exit sub-object mode. See Figure 9.

Figure 9: Choosing Remove Top in the Slice Parameters makes a clean cut at the roof surface.

It frustrates me a bit that I can’t explain exactly why this work, but it does. I’ve tried it on objects in many orientations on surfaces of different angles.

The only case where I’ve found it not to work so far is cutting on a surface generated using a concave surface using max Extended Primitive called an Star Hedra. It is also difficult to have function with curved surfaces as you might expect.

If you need this functionality, use it. If not, that’s fine, too! It fit the needs of the person who asked the question perfectly and left me scratching my head after I came up with the solution.

Summary

You’ve learned about a couple of work methods that accomplish certain specific tasks, but always keep the workflow in mind so that you may adapt the processes to modeling tasks you may encounter.

Hope to see you at various events throughout the summer and fall.

Good luck and have fun

Ted

DOWNLOAD MAX FILES

You must be logged in to post a comment. Login here.

About this article

Chain Link Fences and Slicing Planes

visibility4.74 k
favorite_border0
mode_comment0
Report Abuse

About the author

Jeff Mottle

Founder at CGarchitect

placeCalgary, CA