Creating and Adjusting Texture Maps


You've already seen how to assign a material to an object by adding the granite pebbles and glass materials to the buildings in the Facade3.dwg file. Many of these materials use bitmap image files to simulate textures. You can create your own surface textures or use bitmaps in other ways to help enhance your rendering. For example, you can include a photograph of existing buildings that might exist within the scene you are rendering.

Figure 17.24 shows a bitmap image that was scanned into the computer and edited using a popular paint program. Now imagine that this building is across the street from the Facade model, and you want to include it in the scene to show its relationship to your building.

click to expand
Figure 17.24: A photographic image of a building that was scanned into a computer and saved as a bitmap file

The following exercise will show you how it's done:

  1. Click Redraw on the Standard toolbar and then adjust your view so it looks like the top image of Figure 17.25.

    click to expand
    Figure 17.25: Adding a bitmap image of a building to your rendering

  2. Draw a line 133 ¢ long, as shown in the top image in Figure 17.25.

  3. Change the thickness of the line to 80 ¢ by using the Properties palette.

  4. Choose View   Render   Materials. Then, in the Materials dialog box, click New. Notice that the New Standard Material dialog box is the same as the dialog box for the Glass material. The settings are not the same, however.

  5. Enter Build1 for the material name .

  6. Make sure the Color /Pattern radio button is selected, and then click the Find File button in the lower-right corner of the dialog box.

  7. Click the List Files Of Type drop-down list. Notice that you have several file types from which to choose.

  8.  On the CD      Choose TIF from the list and then locate the Market2.tif file. This file comes with the other sample files on the companion CD.

  9. Click Open to exit this dialog box. Then click OK in the New Standard Material dialog box.

  10. In the Materials dialog box, make sure Build1 is selected in the Materials list and then click the Attach button.

  11. Select the line you added in step 2 and then press .

  12. Click OK to exit the Materials dialog box, and then render the scene. Your view will look like the bottom image in Figure 17.25.

The bitmap image does not appear properly in the rendered view. Instead, it looks like a vertical streak of colors. When you see this streaking, you know your bitmap image or material is not properly aligned with the object to which it is attached.

The following exercise introduces the tools you need to properly align a bitmap image to an object:

  1. Redraw the screen. Then choose View   Render   Mapping or click Mapping on the Render toolbar.

  2. At the Select objects: prompt, select the extruded line you created in the preceding exercise. The Mapping dialog box opens.

  3. Click the Adjust Coordinates button to open the Adjust Planar Coordinates dialog box. Notice the rectangle in the Center Position area. This shows the relationship of the bitmap image to the object to which it has been assigned. All you can see is a vertical line.

    click to expand
  4. Click the WCS YZ Plane radio button. The plane defined by the y- and z-axes is parallel to the surface on which you want the bitmap to appear.

  5. Click the Preview button. Now you can see how the bitmap will appear on the vertical surface. You now need to adjust the positioning of the bitmap.

  6. You want to increase the size of the bitmap in relation to the surface so the image of the building completely covers the surface. To do this, you need one other dialog box. Click the Adjust Bitmap button to open the Adjust Object Bitmap Placement dialog box (see the first image in Figure 17.26).

    click to expand
    Figure 17.26: The Adjust Object Bitmap Placement dialog box

  7. Enter 0.95 in the Scale input box to the left of the U, and then enter 0.76 in the Scale input box to the left of the V. The U is the horizontal direction scale, and the V is the vertical direction scale.

  8. Click the Preview button to view the effect of the scaling. Notice that the image is larger but still not centered vertically.

  9. Use the vertical Offset sliders to move the outer rectangle in the graphic upward so it looks like the second image in Figure 17.26, and then click the Preview button again. Now the image fits within the rectangle.

  10. Click OK in each of the dialog boxes to close them, and then render the model. Your view will look like Figure 17.27.

    click to expand
    Figure 17.27: The rendered view with the bitmap image adjusted

Notice that the image of the building across the street now appears correctly and no longer looks like vertical streaks. The odd blank spaces formerly visible on the building are also gone. As you have seen in the previous exercise, the Adjust Object Bitmap Placement dialog box enables you to stretch the image vertically or horizontally in case the image is distorted and needs to be fitted to an accurately drawn object.

Another option is to use a paint program to refine the bitmap image before it is used in Auto- CAD. AutoCAD attempts to place the bitmap accurately on a surface, so if the bitmap is fairly clean and doesn't have any extra blank space around the edges, you can usually place it on an object without having to make any adjustments other than its orientation.




Mastering AutoCAD 2005 and AutoCAD LT 2005
Mastering AutoCAD 2005 and AutoCAD LT 2005
ISBN: 0782143407
EAN: 2147483647
Year: 2004
Pages: 261
Authors: George Omura

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net