BACK    HOME

AutoCad Landscape Objects


1. Cadense Third Dimension Column Article (Summary)

Instant Trees

Suppose you have constructed a 3D surface model of a houseto give an idea of what the finished house will look like. It did not take long because the house is mainly flat surfaces made with the 3DFACE command. Windows and doors are the most complicated objects in the model, but hopefully you can adapt and use some from previous projects. However, the preliminary rendering of the house looks stark and barren. You need to add something such as trees and shrubs, and perhaps even a person, to give it some life.

The renderer that comes with AutoCAD R14 has some tools for adding realistic accessory objects to renderings. Since these objects often represent trees and shrubs, they are referred to as landscape objects but includes objects to represent people, signs and vehicles for example.

Thismonth, we will examine these landscape objects. We will look at their properties and then we will show you how to install them in a rendering of the 3D surface model of a house. As you would expect, either photo real or photo raytrace rendering must be used for landscape objects to have an effect in renderings.

Landscape Object Properties

Landscape objects are somewhat comparable to the cardboard or wooden cutouts used in store window displays or as scenery in low-budget stage plays, in that they are a 3D image projected onto a flat plane. However, they have a built-in intelligence that goes far beyond cardboard cutouts. For one thing, landscape objects can be set to automatically rotate so that they always face the current view direction. For example, if a landscape object of a tree is installed in a view that is facing due north, the full profile of the tree will be shown. If you switched to a view facing due east, the image of the tree will rotate 90 degrees so that its full profile will still be visible. View aligned landscape objects also work in multiple viewports. You can have four viewports, each with a different view direction, and renderings in each of the viewports will show the full profile of the landscape objects. Image rotation is always on an axis perpendicular to the User Coordinate System (UCS) x-y plane. Therefore, only the top edge of landscape objects are seen from a plan view. Of course, you would not want to see a full profile of objects such as trees from plan view.

Landscape objects also cast shadows that accurately match the outline of the object. For shadows, however, landscape objects are treated as 2D objects. Thus, for example, if the shadow casting light is directly behind a landscape object tree, the shadow will look just like the shadow of a real tree when the sun is directly behind it. If, though, the direction of the shadow casting light is almost 90 degrees from the viewing angle, the shadow will be just a thin band. Landscape object shadows are enabled only when Raytrace rendering is in effect.

By default, each landscape object is projected onto a single plane. You can, however, project the object onto two planes that intersect at midplane and are perpendicular to each other. The images on the two planes are seen at a 45-degree angle when crossing plane landscape objects are view aligned. This gives the object a more slender look, and can result in more realistic shadows for some light positions. If your landscape object is a sign, though, you will want to stick with a single plane.

Bitmaps for Landscape Objects

Every landscape object is based on two bitmap files. The image file contains the image you will see in the rendering. It will have a black background. The opacity file also has a black background, but the area of the image is shaded white. The bitmap files AutoCAD supplies for landscape objects all have a TGA filename extension, but BMP, GIF, TIF, JPG and PCX files are also accepted.

This image and opacity file combination is similar to a texture and opacity map combination in a rendering material. In fact, you can use the bitmap file pairs that Autodesk intended for landscape objects in a material, and attach the material to a 3D face to create your own landscape objects. There is no reason to do this, though, since it involves more work and the results are not as flexible.

The image file and its companion opacity file are linked through the LSLIB command. This command also allows you to assign a meaningful name, such as Eastern Palm, to a pair of files. Similar to material libraries, you can group any number of landscape objects together and save them in a landscape library file. They always have a filename extension of .lli. AutoCAD comes with a landscape library named render.lli that contains all eleven landscape objects that come with AutoCAD.

Landscape Object Parameters

Landscape objects are easy to install in a drawing, and they are easy to manage. The command that installs them, LSNEW, displays the dialog box shown in Figure 4 (not available on the web) for you to use in choosing a landscape object and in setting its parameters. At the top of the dialog box is the name of the current landscape library, and below this name is a list box showing the landscape objects that are in it. If the landscape object you want is not in the current library, exit the LSNEW command and use the LSLIB command to open the landscape library file that contains the object you want. That landscape library will then be the current one, and the LSNEW command's list of landscape objects will include the object you want to install. While not being able to change libraries from the LSNEW command is awkward, it is not really a problem because AutoCAD supplies the files for only 11 landscape objects-and they conveniently fit in one library.

You can install just one landscape object each time LSNEW is invoked, and you select the object by clicking on its name in the dialog box's list box. You can see what the selected object looks like by pressing the preview button.

Once you specify the landscape object to be install, specify its geometry style by picking one of two choices. Single Face causes the images to be projected onto a single plane, while Crossing Faces projects it onto two intersecting planes. Both single and crossing faces are always perpendicular to the current UCS x-y plane. The landscape object's name is displayed in non-rendered views near its base.

The View Aligned check box controls whether or not the landscape object automatically rotates to match the view direction. In non-rendered views, a single face object that is view aligned appears as a triangle, while one that is fixed appears as a rectangle. Crossing face objects appear as intersecting triangles, whether they are fixed or view aligned. Initially a fixed object is parallel with the UCS z-x plane, but you can rotate it (by its grips or with the ROTATE command) after it is installed. As you might expect, you cannot rotate view aligned objects.

The current drawing units are used in specifying the height of landscape objects. Thus, when we install landscape objects later in the drawing file of the 3D house, we set the height of people to about 72 inches (6 feet), and trees to a height of about 480 inches (40 feet). Height is in the positive z direction of the current UCS. It can be specified by the dialog box's slider or by entering a value in the edit box labeled Height. The maximum value you can specify using the slider is 100, while the maximum height you can enter in the edit box is 9999. If you do not specify a height, AutoCAD makes the object 20 units tall.

You specify a location for your landscape object by pressing the button labeled Position. The dialog box is temporarily dismissed and a command line prompt asks to specify the base point of the landscape object. The default location is the origin.

Once a landscape object is installed in a drawing, you can use AutoCAD commands-or grips-to move, copy or erase it just as you can any AutoCAD object. The basic parameters of a landscape object can be changed through the LSEDIT command. You can select only one object, and you must select it by picking a point on it. AutoCAD then displays a dialog box almost identical to the one used for installing landscape objects, with the name of the landscape object highlighted. Although the other landscape objects in the current library are displayed, they will be grayed out and cannot be accessed. You can only edit the selected object, and you cannot change its object type.

Installing Landscape Objects

We will liven up the rendering of the 3D surface model house by adding some landscape objects. If you want to install these objects yourself, retrieve the surface model and textures from the CADENCE Web site (www.cadence-mag.com). The files are contained in the August 1998 code archive, and consist of: house3d.dwg, brick.tga, ggfol.tga and shing1.tga, which are bitmap files that do not come with AutoCAD. You can install the landscape objects and make a rendering without these files, but the texture maps for the bricks, roof shingles and grass will not appear. AutoCAD does have bitmap files for bricks and shingles, but their images are not as realistic as those in these files. You should place these files in the same folder as your other rendering bitmap files. If you accepted the default folder names when you installed AutoCAD, the rendering bitmap files will be in Program Files\AutoCAD R14\Textures. The image used for a background is in file cloud.tga, which does come with AutoCAD. Every step we describe can be done with AutoCAD R14, or with AutoCAD R13 and AutoVision R2.

If you used the typical AutoCAD installation procedure, you may not have all of the landscape objects you'll need for this exercise. You can check this by starting the LSNEW command. The current landscape library should be render.lli, and there should be 11 objects in the list box. (If render.lli is not the current library, start the LSLIB command to find and open render.lli so that it is the current library.) If there is only one landscape object listed in render.lli, you will need to copy some files from the AutoCAD R14 installation CD-ROM to your computer. First, copy all of the files in the Acad\Textures folder on the CD-ROM to your computer's Program Files\ AutoCAD R14\Textures folder (or to the comparable folder if you did not use the default installation folder names). About 140 files will be in this folder. Next, copy the file Acad\ Support\render.lli on the CD-ROM to your computer's Program Files\AutoCAD R14\Support folder. This file, which is about 735 bytes, replaces the one in your computer that has only about 40 bytes. (Incidentally, these library files are in ASCII format, so you can read their contents with Notepad.)

You will render the view named PER_80_40 that is in the house3D.dwg drawing file; you should make certain that it is the current view. It is a perspective view that has a camera-to-target distance of 80 feet and a zoom level of 40 mm. A rendering of the house, before the landscape objects have been installed.

The first landscape object we'll install will be a person. Start the LSNEW command. You can do this in any one of three ways: Through the View/Render pulldown menu; with the Landscape New button on the Render Toolbar; or by entering LSNEW on the command line. When the Landscape New dialog box appears, click People #2 in the list box. If you then click the Preview button, you'll see that this object is a casually dressed man. Set his height to 72, and make certain that the Single Face radio button and the View Aligned toggle are checked. Press the Position button, and enter the coordinates 324,96,12 (or 27',8',1') in response to AutoCAD's command line prompt to choose the location of the landscape object's base. Since you are working in a perspective view, you cannot use your pointing device to specify the point. When the dialog box reappears, click the OK button to end the LSNEW command. The landscape object will appear as a triangle in front of the front house door, but will be replaced by the image of the person when rendered.

That's all there is to installing landscape objects. Just pick one, set its parameters and specify its location. If you change your mind about its parameters, use the LSEDIT command to modify them. If you want to change its location, use AutoCAD's MOVE command.

All of these objects are to be view aligned. A crossing face was used for the sweetgum tree so that it is thinner and doesn't hide much of the house. Crossing faces were used on some of the wandering yew bushes to create some variation between the objects. Notice that all position coordinates are given in feet, and that they are on the World Coordinate System x-y plane. An easy way to locate these objects is to divide the AutoCAD graphics area into two or more viewports; set a plan view in one of them; and use your pointing device (with a snap to grid setting of 12) to specify their location. You can also create the duplicate wandering yew objects through AutoCAD's COPY command.

When you make your renderings, be certain that photo raytrace rendering is in effect, so that the landscape objects will cast shadows.

These are all of the landscape objects we will use, but you might want to install some on your own. They are easy to work with, and your only complaint may be that there are not enough of them. You can also experiment with the surface model in other ways. The model is complete on all sides, and you can use it for experimenting with lights and materials, and in setting views.

John Wilson is president of Computer Based Drafting in St. Louis Park, MN.