- It´s a Breeze! |
By Dave Jerrard
Figure 13. Selecting the points before merging will provide an up-to-date point count at the bottom of the screen.
Figure 15. A close-up of the leaf spheres after a slight Jitter.
Figure 16. A single leaf
cluster showing the effects of changing the Polygon Size value. From left
to right, a polygon size of 50%, 100%, and 200%. Note the way the polygons
overlap at values higher than 100%.
Figure 17. Three images of the same tree rendered with different Polygon Size settings. From top, a setting of 10%, 100%, and 150%.
You've just spent the last few weeks tweaking the details of the recreation facility your client had you build in LightWave 3D, and everything looks great! The classic black trim around the windows, the smooth-formed concrete walls, the grassy lawn in the playground—everything looks real enough to touch, ready for that animated walkthrough. But wait! At the last minute, he walks in and says, "Everything's great, but can you add a few trees here, and here?"
A few trees? A FEW TREES? Gee, does he want them to have leaves blowing in the breeze while you're at it? "Great idea! We can start the walkthrough from under a big tree here, and walk up to the main entrance." Well, so much for cheating your way through by using panels mapped with tree images. These have to look real from all sides now! The big question is how? You've come to the right place for the answer.
1. First load up Modeler. The majority of the work will be done here. Size and position the grid so you have about eight meters of space above the ground plane in the front view.
2. In the Top view, use the Cone tool to drag out a box, approximately half a meter square. In the Front view, stretch this box so it reaches from the ground plane up to the 8-meter mark on the Y-axis. Bring up the Numeric panel by typing "N" and enter a value of 4 for the Sides, and a Segment value of 10 or more. The higher the number of segments, the more detailed the tree will become. Click OK, and hit the Enter key to make the cone. This will be our tree's trunk.
3. Select the Taper 1 tool and hit the "N" key to pull up its numeric requester. Set the Axis to Y, Range to Automatic, and Sense to +. Click on the Ease Out button to activate it. Type in a Factor value 2, and make sure the center fields are all set to zero, then hit Apply. This will thin out the middle portion of the trunk a bit, making the final object a bit better looking (see Figure 1).
4. Zoom in to the top segment of this trunk. Select the polygons of the top segment, and type "X" to cut them out. Flip to an empty layer, and paste them there. Now, flip to a second empty layer, and paste them there as well. If you wish, you may also do this in a third layer, but for now, we'll just stick with two.
5. Select the top point of the segment in one of the layers. We're going to move this around a bit, and there are several methods that we can use to do this. Since this is a single point, we'll just use the Drag tool for now. Use the tool to drag the point off center in some direction. You can use any view you want, but try to keep the angle of this segment within 45 degrees of vertical.
6. Once that is done, flip to the other segment layer and do the same, but in a different direction. Put the other segment layer in the background to make things easier to visualize. What we're doing here is splitting the top segment of the trunk into two small branches. Feel free to adjust the lengths of these segments so they are not equal. (see Figure 2).
7. Put both of these layers into the foreground and enter Polygon mode. Hit "W" to bring up the Polygon Stats panel. Select all polygons by clicking on the + button next to Total Polygons. Hit OK, then cut these using the "X" key. Flip back to the first layer, where the rest of the tree is, and paste the branches into it, then merge the points. You should now have a Y-shaped object, with a very long stem.
8. From here, things will get a bit repetitive. Zoom out a bit until you see the top TWO segments—the segment we just split, and the one immediately below it—and select these polygons. Use the Lasso to quickly select these. Cut these selected polygons, and paste them into two empty layers.
9. Switch to Point mode, and select all the points, except the four bottom ones, in one of these layers. Simply dragging a lasso around the two previously made branches will do this effectively.
10. Again, we're going to split this branch. This time, we'll use the Rotate tool. One thing to be very careful about is to not move the four points at the base of these sections because they will have to line up with the points of the original trunk. With the rotate tool, place the cursor near the four unselected points in either the front or side view, and rotate freely. Don't rotate so far that the branch tips drop below the base, do it just enough to separate this layer from the other one. Remember not to constrain your operations to one view. Feel free to adjust the angle in any view (see Figure 3).
11. Switch to the other layer and repeat a similar modification on the other branch. Again, randomize the actions a bit. This will help prevent the tree from looking too symmetrical. Other tools may also be used to split the branches. Move and Shear also work well for bending the branches into shape.
12. When this section is done, cut both layers and paste them back onto the trunk and merge points once again. And again, zoom out a bit, select the top three segments, and paste them into two separate layers. From here on, we'll repeat steps 8 through 12 until we either use up all the segments on the trunk, or we're satisfied with the shape of the tree. This may seem like a long, drawn-out process, but after you get the hang of the first few segments, it goes by pretty fast. When we get to the last couple sections, the number of polygons gets fairly large.
After about five of these split operations, the tree will start to look very tree-like (see Figure 4). About every third or fourth segment, place the cursor over a section, centered at zero in the Top view, and type an "E" or "R" to rotate the entire object 90 degrees. This also will help ensure that the branches don't get too symmetrical. This is the only time the bottom four points should be adjusted.
13. Once the tree is branched to your satisfaction, it's time to fix the trunk. As you can see in Figure 5, the final trunk segment looks a bit squashed. This is easily fixed by selecting all the points except the bottom four again, and merely moving the branches up. All that remains is to smooth out that four-sided trunk. First, save this object as tree.lwo.
14. Select the polygons of the trunk and the two branches above it, and cut them out. Paste these into a separate layer. If your tree has more large exposed branches above this section that may be seen clearly, cut these and paste them into this layer as well. We have to do a little cosmetic surgery on these branches before we can smooth them out.
15. Switch to a new layer, and place these branches into the background. In either the front or side view, whichever shows the branches with least overlap, create a simple polygon that fits around the intersections of the branches as close to their bases as possible. Usually a simple three-point polygon will do the job. Do this for each branch intersection (see Figure 7).
16. Swap layers by typing the ['] key. Go to the Tools menu, select the Drill tool and then select the Slice option. If you created the polygons from step 15 in the face view, then set the Axis to Z; otherwise, use X. Click the OK button, and the branches will be sliced near their bases. If you have any leftover branches that you couldn't slice because of their orientation, go back and follow the last two steps, but use the other view instead. You should end up with something similar to that in Figure 8.
17. Once the branches have been sliced, select the newly formed polygons that make up the branch intersections (see Figure 8). Cut and paste these polygons to a new layer, then Triple them. Next, select the two branching stubs by dragging a Lasso around them, making sure the trunk section (or main branch) is left unselected. Cut and paste these into another layer. Now, select the polygons of one of these branches. Again, cut and paste these to a new layer. You should now have three layers, each containing a different branch stub.
18. Select one layer containing a branch stub, and put the other branch stub layer into the background, as in Figure 9. Type "B" to bring up the Boolean panel and choose Union from the list. Click OK and you should have both branches showing in the foreground layer. Merge points, then cut and paste this object back onto the base of this intersection. Merge the points again.
19. Go to the Polygon menu and select the Subdivide tool. Click on MetaForm, and then OK. You should end up with an object similar to that in Figure 10. Now we're getting a more organic look to this tree. Undo this, and move this section back into the original layer containing the rest of the lower branches. If you have more sections to do, follow the last three steps for these as well.
20. Once you have all the branch intersections for these branches booleaned and placed back into their places, merge points again. Bring up the Polygon Statistics panel by typing "W" (while in Polygon mode). Watch for any polygons that contain more than four points. Click the "+" button next to the number labeled ">4 Vertices" and then OK. Triple these polygons by typing "Shift-T." Deselect everything.
21. Cut this object and paste it back into the layer containing the rest of the tree. Merge points, and then select the polygons at the very bottom of the trunk. Delete it since it is not needed. Now, using the Lasso, select all the polygons you just pasted into this layer again (see Figure 11). MetaForm these polygons using Subdivide-MetaForm. Do not use the MetaForm Plus plug-in for this, as it will not give the desired result here. For a little more realism, add a fractal value of 0.1 to 0.2 to the MetaForm function. This will roughen up the tree a bit, making it look a little more natural. Two passes of this MetaForm will be sufficient (see Figure 12).
22. At this point, you may want to resize the tree a bit, since all the modifications that have been done may have altered its height quite a bit. For now, scale it down to about 10 meters in height. Triple all the polygons and then type "Q" to bring up the Surface panel. Rename the surface to "Tree," then save this object again. After surfacing in Layout, this tree is ready for any winter scene you have in mind. For the summer scenes, though, we need leaves.
23. For starters, switch to an empty layer. Under the Objects menu, select the Ball tool. Drag out a sphere centered at the origin, with a diameter approximately 1 meter. Make it about a half a meter or so in height. Type "N" to bring up the numeric panel. Make sure the Ball Type is set to Globe, and then enter a value of 8 for the sides and 4 for the segments. Click OK. We now have a rough sphere consisting of 32 polygons. Triple these since we'll be deforming this object a bit later. This should bring the total number of polygons to 48.
24. Bring up the Surface panel again by typing a "Q". Name this surface "Leaves" and hit OK.
25. Switch back to the tree object we just saved. If you cleared it, reload it into an empty layer. In Point mode, select all the points except those that make up the trunk. Copy these to an empty layer. We're going to use these points to Particle Clone the sphere object we just created. First, we need to reduce the number of points, drastically. Select all points in this layer.
26. Type "M" to bring up the merge points panel. Switch to the Absolute option, and type in a value of about 0.1 meters, then click OK. This will remove several points that are close together. What we want to do is drop the number down to less than 1,000, so we'll probably have to perform this merging a few times. If the first merge doesn't eliminate enough, try again, but this time use a slightly higher value, like 0.15 meters or so. Since these points are selected, we will have an up-to-date point count displayed at the bottom of the screen (see Figure 13).
27. Once the points have been reduced to 1,000 or less, switch back to the layer with the sphere. Place the layer with the points we've been working on into the background, then go to the Objects menu and select the Particle Clone plug-in. If you don't have this, it can be downloaded from the NewTek Web site. A progress indicator will appear and after several moments, the sphere will be duplicated many times, looking much like foliage on the tree. All that remains is to delete the original sphere that still exists at the origin (see Figure 14).
28. Now we have a tree that looks like it has bubbles for leaves. We can fix that by applying a Jitter to them. Bring up the Jitter panel by clicking on the Jitter option under the Tools menu. Select Uniform from the list, and enter a value of 200mm for each numeric field. Click OK and in a few seconds, the display will update with a much less bubble-like appearance (see Figure 15).
29. Save this object as Leaves.lwo and exit Modeler. The rest will be done within Layout itself, so load that up.
30. The First thing to do is to give our objects textures. Load in the Tree.lwo object. Open the Surfaces panel for the tree, and enter the values below. These create a good generic bark texture.
Color: 156, 120, 90
We're using Texture Falloff on the bump map to simulate the smoothness of newer growth while keeping the trunk and lower branches fairly rough. Since our tree is about 10 meters tall, a falloff of 10% per meter on the Y-Axis will ensure that the upper branches will remain smooth. Likewise with the X and Z-Axis. Save this tree again so you don't lose the texture.
31. Load in the Leaves.lwo object and select the surface for it on the Surfaces Panel. We'll give this a simple leafy green texture. Again, here's a good set of values to get started with.
Color: 50, 155, 65
If you were to do a test render now, your tree would still look a bit weird, but better. Save all objects so we don't lose the textures. Now let's finish it off.
32. Open the Objects Panel for the Leaves object. Click on the button for Clip Maps and choose the Veins texture. Use a Texture Size of about 0.2 to 0.3 meters. Set the Texture Value to 100% and Coverage to 0.2. Enter 0.2 in the fields for Ledge Level and Ledge Width as well. Give this a bump strength of 1.0 and do another test render. This time, you should have a very leafy tree. Save the scene as Tree.lws so you don't lose the clipping information. It would also be a good idea to parent the leaves to the tree before saving the scene.
What happened is we've used the Veins texture to cut random strips out of the leaf "spheres" to simulate clusters of leaves. Veins works particularly well for this since it creates wedge-shaped sections, which have a remarkable resemblance to leaves. The bump value helps to add a slight highlight to the edges of these leaves, making them seem to have thickness. A larger texture size will make the leaves appear larger and fewer while a smaller texture size will make many more smaller leaves, so experiment with this for the look you like. Also, a higher Coverage value will increase the spacing between leaves and make them appear smaller.
If you really want to have fun, you can animate the leaves growing over time. To do this, we just use an old LightWave feature most people have forgotten—the Polygon Size control. By ramping a Polygon Size envelope from 0% to 100% over a series of frames, the tree will go from a barren leafless wintery tree to a full summery shade tree (see Figures 16 and 17). You can use values higher than 100% to thicken the leaves if you find them to be a bit sparse. Just remember if you increase the polygon size, the clip values will increase with it, so you might want to reduce the clip size.
You can also simulate a breeze rustling the leaves by moving a fractal bump map through them. This will create moving shadows that make the leaves appear to move. A fractal displacement also can be used to move the leaves as well. Use a Texture Size of 0.1 meters and a Texture Velocity of 0.01 meters for a nice gentle breeze effect.
By saving this as a scene, you can easily use the Load From Scene button to bring this tree into any other scene and keep all the clipping and displacement information intact. This will make it easy to quickly landscape that park. At least until the client considers a nice big Douglas fir.
Dave Jerrard is one of three authors of the book "LightWave 3D Applied - Version 5.6" that is in stores now! Click here to visit the LightWave Applied Web site.
Animation Artist magazine would like to thank Dave Jerrard and NewTekniques magazine for the second serial rights to this article to benefit readers of Animation Artist.
Dave Jerrard is the lead tutorial writer for NewTekniques magazine. If you enjoyed this tutorial, please consider subscribing to NewTekniques, where you´ll get a new and detailed tutorial from Dave Jerrard (and other industry leaders) in every issue. For information on subscribing to NewTekniques magazine, click here.
This tutorial originally appeared in the April/May 1998 issue of NewTekniques magazine and is reprinted here in Animation Artist magazine with the permission of both Dave Jerrard and NewTekniques magazine.
This tutorial is ©copyright 1998 and may not be republished elsewhere without the expressed written consent of Dave Jerrard and NewTekniques magazine.
|Trees-It's a Breeze||Inbetweening|
|Create Gold||Creating Drapes|
|Advanced Bones||Using Layer Masks|
|Repurposing Your Animation Content|
Return to Animation Artist Magazine Home Page