As part of the DIRSIG 4 development project and the MegaScene1 construction project, a new tool was created that allows the user to perform two primary tasks:
Import objects from external CAD programs, attribute them and save them in the native DIRSIG object (GDB) format.
Create new scenes and edit existing scenes by assembling together collections of attributed objects.
The resulting tool became known as Bulldozer and it is an OpenGL based application that allows the user to perform these very common object attribution and scene construction tasks in an environment with a "what-you-see-is-what-you-get" and "drag-n-drop" style interface. Although Bulldozer is powered under the hood by DIRSIG 4 components, we have made the tool available as part of the DIRSIG 3 distribution.
Create a temporary workspace in your home directory with a name related to this tutorial (for example, mkdir ~/tutorial3). Change your current directory to this directory that you just created.
To start the Bulldozer tool, simply run the command bulldozer from the command line.
prompt> bulldozer
The initial documentation for this tool can be found in The Bulldozer User Manual or by clicking on the Contents item on the Help menu within Bulldozer. If your user environment is correctly configured, a help browser will start up in a new window that contains a basic hyper-linked manual (see Figure 11-1). You may want to browse this manual to learn about topics not discussed in this tutorial.
The tool has two modes: (i) object mode and (ii) scene mode. Each of these modes is briefly described in the following two sections, however, both of these modes will be explored in greater detail through the course of this tutorial.
In the Object Mode, the user can open existing DIRSIG GDB files or import new objects from external CAD programs through common geometry formats. Object Mode is the default mode when Bulldozer is started.
The region on the left side of the application is the Part List for the current object loaded into the editor. The region on the right side of the application is the Material List that can be used to attribute the current object loaded into the editor. The View Selector in the top-center allows the user to quickly change the direction the object is being viewed from. The three (3) controls at the bottom-center allow the user to select what actions are assigned to the three mouse buttons. The central black area is the OpenGL window that will display the geometric objects loaded into the tool.
In Object Mode, the user can select different parts of the object and then drag materials from the Material List onto the model to attribute it. The material properties can be created, deleted, copied and edited from within Bulldozer to streamline the creation of new objects. Other tasks including surface normal correction can also be performed in object mode.
In the Scene Mode, the user can combine individual object (GDB) files into a larger object database (ODB) file that represents a scene. When the user switches from Object Mode to Scene Mode, the appearance of the tool changes slightly. In Scene Mode, the region on the left side of the tool is called the Used Object List and it stores the list of objects currently in the scene. The region on the right side is called the Available Object List and it stores the list of objects that can be inserted into the scene. All other aspects of the user interface are the same as they were in Object Mode.
In Scene Mode, the user can select an object from the Available Object List and insert them into the scene. Objects in the scene can be moved, resized, rotated, etc.
In this section, we will walk through the tasks involved with importing a CAD model into Bulldozer and attributing with DIRSIG material properties.
The first step is to start up the Bulldozer tool in the tutorial directory.
prompt> bulldozer
By default, Bulldozer starts in Object Mode, however, you can always find out what mode you are in by looking at the bottom-left region of the window (see Figure 11-2). In this area you will either see Object Editing Mode or Scene Editing Mode. For future reference, to switch modes you must click on the item in the Mode menu in the main menu bar. The Mode menu always contains an item that will switch you to the other mode.
The first thing we want to do is load a set of materials into the tool so that we have them available to attribute our model with. For this tutorial we are going to load the standard DIRSIG material file into Bulldozer. Move the mouse into the Material List panel on the right side of the tool and depress the right mouse button. A pop-up menu will appear with a standard set of file operations (New, Open, Save, etc.). Select the Open item from this menu to open a standard file selection dialog. Change the Look in: directory to $DIRSIG_HOME/lib/data/materials and select the file standard.mat from the file listing (remember to translate $DIRSIG_HOME into the directory name corresponding to your installation).
Once the material database has been loaded, the list of material names will appear in the left panel. You can edit the properties of any of these materials by either double-clicking on a material name or by selecting it and choosing the Edit option from the right mouse click menu. Editing a material will cause the "Material Editing" dialog to appear (see Figure 11-3). This dialog is discussed in detail in the "DIRSIG GUI Manual". The one item that is of interest to us with regard to this tutorial is the Editor Color property that appears on the General tab. This is the color that will be assigned to facets loaded into Bulldozer with that material assigned to them. To change the color you can type in a new set of RGB values or click on the color panel to start up a standard "Color Selection" dialog. To store any changes to the material, click the OK button at the bottom of the dialog
Figure 11-3. The Material Editor dialog allows the user to modify the properties of a specific material.

It is important to note that if you do make changes to any of the materials loaded into Bulldozer that you must save them to a file to retain those changes for future use. This can be accomplished using either the Save or Save As items on the Material List panel right mouse click menu. If you attempt to exit Bulldozer with unsaved changes in the material database you will be issued a warning.
The object that we are going to import and attribute is a Boeing 737 that was created in a CAD package by an external source. This object is stored in the Alias/Wavefront OBJ file format. This is a common output format supported by many CAD packages an it is one of the most reliable methods to export an object out of a CAD package and into DIRSIG. The OBJ files typically have a .obj file extension.
To open this file, click on the Open Object ... item in the main File menu which will open a standard file dialog window. Change the Look in: field to point to the $DIRSIG_HOME/lib/data/gdb/objs directory. This directory contains a few OBJ format files in it, however, the center file listing should be empty at this time because the default file type to filter is the DIRSIG GDB files. We can remedy this by changing the File Type: box at the bottom of the dialog to Alias/Wavefront (*.obj). This should update the file listing and the file 737.obj should be included in the listing. Double-click on this file or select the filename and click the Open button.
A small progress dialog will then appear while the object file is being loaded. Then, the following pop-up window will appear:
Figure 11-4. This warning dialog tells the user the materials the object uses which are not available in the currently loaded database.

This message indicates that the object that was loaded was requesting material ID 0 (which is an invalid/reserved ID). In short, this is the way that Bulldozer tells you that the object currently has no valid materials assigned to it. Click the OK button to close this window.
The 737 model should appear in the OpenGL window in the center of the tool (see Figure 11-5). In the left hand panel you will notice a listing of names has now appeared. This panel is called the Part List and lists the names of the parts that were defined in the input geometry file. Depending on the object creator there may be only one part name or hundreds. A good object builder will define logical parts and assign them logical names (i.e. engine, hood, rudder, roof, etc.)
Now that an object has been loaded into the tool, you can use the mouse to explore it. The View Selector buttons above the OpenGL window will quickly change your viewpoint to a set of predefine positions (see Figure 11-6). For example, if you click the Front button the front of the object should be facing you in the window. If you load an object and the front view is not the "front" of the object, this is not a problem with Bulldozer but rather evidence that the geometry file was written with different axis conventions.
Figure 11-6. This View Selector allows the user to view the object or scene from a set of predefined positions.

To perform freehand viewpoint changes you can use the mouse within the window. Beneath the OpenGL window is a set of three (3) controls that define the actions associated with each mouse button (see Figure 11-7). The left mouse button is usually assigned the Rotate View action. If it isn't currently assigned this action select it from the menu inside the Left Button box. To rotate the view using the mouse, click and drag the left mouse button inside the OpenGL window. Moving the mouse left to right or up and down will rotate the object in different directions. This compound rotation control can be changed to simple rotations about the Z axis by selecting the Z Axis item inside the Left Button box.
Figure 11-7. This Mouse Button controls allows the user to define the action associated with each of the three mice buttons.

In addition to rotating the view, the viewer position can be translated and the view can be zoomed in and out. To perform any of these other operations simply assign one of the mouse buttons the desired action.
To perform operations on the object (including material attribution) you must select facets on the object that the operation will be applied to. By default, the right mouse action is assigned the Select property. If yours is not currently set to Select change it now.
The selection action can be performed on either an individual facet basis or on entire parts by selecting the Facet Level or Part Level items in the Right Button box. To select elements of the object simply click on them inside the OpenGL window with the right mouse button. Items that are selected will change color to yellow. The select operation has a toggle behavior so "unselecting" an element entails simply clicking on it a second time.
The other method for selection elements at the part level is to click on part name in the Part List (left panel).
You can "unselect" all of the currently selected elements by clicking the Unselect All button in the Right Button box.
To attribute the part of the model with a material is very straight forward. As our first attribution task we will assign the "rubber" material to the tires on the plane. To assign the material, the desired elements must be selected. Since the model builder did a good job of breaking down the model into logical parts, the easiest way to select the tires is to click on the "wheel_front", "wheel_left" and "wheel_right" names in the Part List (left pane). To see if these parts are indeed selected, click the Left view from the View Selector. You will notice that the wheels and the landing gear struts have been selected. That is because those elements were lumped together under the name "wheel_front", "wheel_left", etc. To select only the rubber parts of the wheels, you would need to switch the mouse Select action to Facet Level and manually select each of the tire facets. For the sake of time in this tutorial, we will live with making the landing gear out of "rubber".
Once the wheels have been properly selected, find the "rubber" material in the Material List (right pane).
To apply the material, you will perform a basic drag-and-drop operation: left mouse press (do not release the button) on the material name, drag the mouse into the OpenGL window and release the left mouse button. A small dialog box will appear to confirm the operation:
Click the OK button to complete the application of this material. Once the material has been applied, the OpenGL window will update with those elements now colored with the Editor Color assigned to the material.
Continue by applying the "Painted Steel Roof" material to the remaining parts of the plane ("engines", "main_body", "nose_cone", "rudder", "wings_front" and "wings_rear").
Once the object has been entirely attributed, you can save it to a DIRSIG GDB file. The Save As option can be selected from either the File menu in the main menu or from the right mouse click menu within the Part List. Once the "Save As" Dialog appears change the Look in: directory to tutorial3 and change the File type: to DIRSIG GDB (\*.gdb). Click on the Create New Folder button at the top right of the dialog (this button looks like a folder with a "twinkle" on the top right corner). This will create a new folder in the file listing with the title New Folder 1. This folder should be highlighted for editing so that you can change the name to something else. If it is not highlighted for editing, click on this folder and leave your mouse over it. Change the name of this folder to gdb by typing the name in the highlighted box and ending with the Enter key.
So far we have not saved the object, but we have created the directory we want to save it in. Double-click on the gdb folder in the file list to change the save location to inside the gdb directory. Finally, type the name 737.gdb into the File name: box at the button of the dialog window and click the OK button to save the object.
Before changing to Scene Mode we will close the current object by selecting the New option from the File menu. A confirmation dialog will pop up within which you must click the OK button. Then, click on the Switch to Scene Mode item on the Mode menu. The interface will change slightly and the words Scene Editing Mode will appear in the lower left of the main window.
We need to have a list of available objects to insert into the scene we are about to build. The right panel of the Bulldozer main window is called the Available Object List and it should be empty at this point in time. To add objects to this list we will tell Bulldozer about one or more directories that contain objects and it will load them into the list. The first directory we want to load is the standard GDB directory that comes with the DIRSIG distribution. Move your mouse into the Available Object List panel and press the right mouse button to pop-up a menu with loading options. This menu will contain New, Open and Merge items. Selecting the Open item will start up a standard directory selection dialog. The distributed GDB files are stored in $DIRSIG_HOME/lib/data/gdb directory. Change the Look in: field to the location of this GDB directory. Remember that the file dialogs do not understand $DIRSIG_HOME so you need to type out the full path to where your copy of DIRSIG was installed (in this tutorial we are assuming that $DIRSIG_HOME is /usr/local/dirsig). When the correct directory is loaded into the Look in: box, the dialog window should contain a list of several sub directories starting with "aircraft" (see Figure 11-10).
Figure 11-10. The directory selection dialog box looking at the GDB file hierarchy distributed with DIRSIG.

Click the OK button to tell Bulldozer to load this top level directory into the Available Object List. Once loaded, the Available Object List should display a hierarchical list of GDB files that mimics the structure of the directory we instructed the tool to load.
Next, we want to merge in our own GDB files (of which we have only one so far). In the Available Object List pane, click the Merge option on the right mouse click menu. Use the directory selection dialog to load the gdb directory that we created in the tutorial3 directory (the directory that we save the 737 GDB file into).
When you have successfully loaded both directories into the Available Object List, your main Bulldozer window should look like Figure 11-11.
To build a scene we will simply insert objects in the Available Object List into the scene. To begin, you must change one of your mouse button actions to Insert Object (many users assign this action to the right mouse button). It is advisable to always start a new scene with the terrain so select the hills object under the terrain listing with any mouse button. To insert the terrain, click inside the OpenGL window with the mouse button that has been assigned the Insert Object action. For the first object inserted into the scene, it doesn't matter where you click inside the OpenGL window because the tool will always insert the object at the origin.
The "hills" terrain is rather large so you will want to "zoom" into the scene before inserting more objects. The zoom or magnification feature is another action that can be assigned to one of the mouse buttons. Change the right mouse button to the Zoom/Magnify action and select the In and Out mode associated with this action. By pressing down with the right mouse button and moving the mouse in the left-right axis you can control the current zoom and magnification. A handy mouse action to use in conjunction with Zoom/Magnify is the Translate View action. Using the Rotate View, Translate View and Zoom/Magnify actions zoom into the center of the scene and position the viewpoint slightly off nadir (see Figure 11-12). You do not have to match the location and viewpoint exactly.
Before inserting the next items, we need to tell Bulldozer how we want to draw the insert objects. To save OpenGL rendering time, Bulldozer allows the user to choose between a "bounding box", "wireframe" or "facet/polygon" view. When extremely complex objects are in use, the "bounding box" view allows the user to quickly manipulate the scene since OpenGL does not need to render every polygon. The default Draw Mode Preference is Bounding Box but for this tutorial we would like to change it to Facet/Polygon. This preference is modified by selecting the Facet/Polygon item from the Draw Mode Preference menu off of the Options menu.
To insert additional objects into the scene, simply select them from the Available Object List and click inside the OpenGL window with the mouse button assigned the Insert Object action. The point where you click will be the location that the object is inserted. Bulldozer will automatically compute the correct height so that the object appears "on top of" the object that you click on. However, Bulldozer does not automatically tilt the object to follow the slope of the surface.
As you insert items into the scene, you will see their names appear in the Used Object List panel on the left side of the Bulldozer main window. Each time you insert an object into the scene, Bulldozer records an instance of the object. Each instance is a set of rotation, translation and scale transforms that are applied to the base object. Under each object name you will see a list of instance names which are automatically generated from the object name. As you insert additional instances of the same object, the list of instances will grow.
Many times after you have inserted an object into the scene, you will wish to modify it by either rotating, translating or scaling it. To change an object instance you must first select it which can be accomplished either by clicking on an instance name in the Used Object List or using the Select mouse action. You should note that multiple instances can be selected to perform operations on.
The modification operations are performed using mouse button actions. You will find Rotate Selection, Translate Selection and Scale Selection under the mouse button action menus.
Since each user can insert any of the objects into any location, we cannot show you what your completed scene should look like. The screen grab in Figure 11-13 shows one possible scene.
To save the scene to a DIRSIG Object Database (ODB) file, select the Save As item from either the main File menu or from the Used Object List panel (left side). It is common practice to create an odb directory to store your .odb files into. Create an odb directory in the tutorial3 directory (parallel to the gdb directory) and save your scene as tutorial3.odb.
To run this scene in DIRSIG you will need to know the following:
The location of the odb directory.
The material file name and path that you used.
The emissivity and extinction path for the files referenced by the material file.