UAV_data - ptabriz/geodesign_with_blender GitHub Wiki


my alt text


Contents:

I. Introduction
II. Importing Agisoft wavefront object
III. Decimating the obj
IV. Refining the surface
V. Refining the texture
VI. Adding materials

Required software and materials

  • Download and install latest version of Blender from here.
  • Download and unpack sample_data folder from here

Drawing
orthophoto
Drawing
relief
Drawing
aspect
Drawing
Waterflow
Drawing
Solar analysis (irradiance map)
Drawing
Solar analysis (insolation time)

I. Introduction

In the tutorial, we will get familiar with techniques for importing, processing and rendering UAS data. The sample data at hand consist of mesh, digital surface model (DSM) and series of analysis maps created from UAV nadir and NSWE oblique imagery (250ft). Mesh and Digital surface models has been generated with AGISoft and analysis has been performed in GRASS GIS. Get the full report of the flight survey here.


I. Preparing the Blender scene

  • Run Blender and open the file "UAS.blend".
  • Set render engine to "Cycles". You can find it in the top header, the default is "Blender Render"

I. Importing Agisoft wavefront object

Wavefront object (.obj) is perhaps the most common 3D mesh format, and a very efficient way to transfer the object's geometry and the material. When exporting UAS meshes to wavefront, the mesh geometry is saved in a .Obj file, the texture information in an image file (e.g., Jpeg, PNG), and the material information in a (.mtl) file. The only drawback of Obj files is loss of georeferencing, meaning that when imported in other software they will be located in an arbitrary or software selected origin. In this step, we will import the mesh file.

  • Go to File > Import > Wavefront objects (.obj) and browse to the sample_data folder
  • Select the centennial_uav.obj
  • In the import options (bottom left side of the import):
    • Change the direction to Z up and X forward (see figure below, left). These parameters are adjusted to the axis direction of the 3D space. For example, Z up means that the height axes is defined as Z with positive up.
    • Make sure that the Image search option is activated so you import the mesh and the material.
    • Press enter to finalize the import. Your imported object should look like the image below on the right.
  • Switch between Wire, Solid and Material shading modes to examine the surface quality.
Drawing Wavefront import panel Drawing
imported object


my alt text


II. Decimating the mesh

3D meshes exported from Agisoft or similar structure from motion (SFM) solutions are usually very dense and contain millions of faces that generate a huge file size and consume exorbitant memory for processing. In Blender's top header you can get live information about the total number of faces in the scene as well as their consumed memory (see figure above).

It is possible to decimate them without loosing the surface details. In IOn this step we will use Decimate modifier to decimate the imported mesh.

  • Select the imported object (centennial_UAV).
  • Change the viewport shading mode to solid mode so you can better see the surface quality.
  • Go to Properties Editor > Modifiers tab > Add Modifier > from the dropdown select Decimate(figure below, left). You will see the decimate panel show up in the properties editor. Notice that the current face count of the object is indicated as 1371299 (figure below, right).
  • Click on the Ratio slider and type in 0.5 (figure below, right). Wait for the process to finish, it may take several seconds depending on your system's computation power. Note: Do not drag the Ratio slider to avoid freezing and crashes. Use keyboard input instead.
  • You will notice that the face count is reduced to half (685645) and the wireframe shows that the polygons are spaced out.
  • Switch the viewport shading to Material to examine the quality loss.
  • In Decimate modifier's panel click on Apply to finalize the modification. This process may also take several seconds.
Drawing
Decimate modifier accessed from the Properties Editor, Modifiers tab
Drawing Decimate modifier panel

III. Global smoothing

It is possible to use blender to smooth the entire mesh to enhance the mesh representation.

  • Select the centennial_UAV object.
  • Change the viewport shading mode to Solid.
  • Go to Properties Editor > Modifiers tab > Add Modifier > from the dropdown select Smooth. You will see the decimate panel show up in the properties editor. Notice that the current face count of the object is indicated as 1371299.
  • Change Factor parameter to 0.5 and repeat to 3.
  • See how the mesh is changing in the viewport.
  • Now change the viewport shading mode to Material to see how the smoothing has affected the texture placement.

II. Refining the mesh.

Blender comes with comprehensive sculpting tools that can be used to make local mesh refinements such as flattening a surface, filling a whole, removing the dents, etc. Note: Sculpting tools are useful for treating existing faces, thus they cannot be used to fill large wholes or reconstruct big chunks of missing data.

  • Select the centennial_UAV object.
  • From the viewport's bottom header > swith from Object Mode to Sculpt Mode. The sculpting panel will show up in viewport's left toolbar in the Tools tab.
  • Pick an area of your choosing that needs treatment to start experimenting with different brushes.
  • General procedure for using sculpting brushes is as following:
    • In the scultping toolbar, click on the Brush thumbnail to see the list of Brushes > select a brush.
    • hover the mouse over the treatment area in 3D view and click to apply the brush. You can click and drag to continuously apply the treatment.
  • Brush options:
    • To change the brush stroke parameters:
      • In the sculpting toolbar, click on Stroke section to expand it:
      • Adjust the Radius parameter to increase/decrease the brush size.
      • Adjust the Strength parameter to increase/decrease the magnitude of the effect.
    • To snap the brush stroke to a specific direction:
      • Collapse Symmetry/Lock section and select X, Y or Z parameters.
  • Some useful brushes:
    • Inflate/Deflate for extruding depressions or decompressing bumps. You can switch between Inflate and Deflate in the toolbox.
    • Smooth for leveling and smoothing surfaces.
    • Snake Hook for dragging the vertices to and close the gaps.
  • Switch back the object interaction mode to Object Mode(viewport bottom header).

III. refining the texture.

The UAV derived textures often include small imperfections such as black wholes. These errors can be treated using Texture paint tool. Consider Texture Paint as a small photo editing software that allows you to edit the textures draped onto the 3D mesh. While texture paint has also variety of brush types, In this tutorial we will only use Clone tool. As the name suggest, Clone tool copies color information from one area (reference) and applies it to another area. The procedure is as follows:

  • Select the centennial_UAV object. viewport's left toolbar in the Tools tab (figure).
  • Zoom-in on an area of your choosing that needs treatment.
  • From the viewport's bottom header > switch from Object Mode to Texture Paint. The texture paint panel will show up in
  • In the texture paint toolbar, click on the Brush thumbnail to see the list of Brushes > select Clone.
  • Adjust the size of the Brush using the Radius parameter ((keyboard shortcuts [ ] for increasing and decreasing)
  • Hold Ctrl key and click on the area that the reference color needs to be picked.
  • Hover the mouse to the area that needs treatment and left-click to paint. Note: Texture paint can be only applied to areas that have geometry but miss color information. Don't expect to fill-in the mesh voids with this tool.

IV. Draping the GIS analysis

In this step, we drape various analysis maps on the obj surface. These include Solar analysis, Water flow simulation, and viewshed simulation. The process is simple. We remove the existing material and assign a Diffuse shader with Image texture to drape the images.

  • To remove the existing materials:
    • Select the object
    • Go to Properties editor > Material > select the material in the material slot > Press - button to remove the material from the slot.
    • If there are more than one material in the slot, remove all of them to clear the slot.
  • To create new material.
    • Create a new material using the + button and rename it (e.g., water flow)
    • Go to Node Editor and reconstruct the node network based on the figures below.

Some general tips for adding nodes:

  • Make sure that your render engine is set to Cycles render.
  • If you don't have a fast processing computer, do not attempt to change node options, while in viewport rendering mode. Finalize your modifications in Material mode and then switch to render.
  • Nodes can be added in Node Editor using Add menu. For easier access to the nodes use node search.
  • Detailed instruction for adding nodes can be found here.

V. Importing GIS textures

  1. What are the benefits and drawbacks of using DSM vs. Obj ?

Add water flow Add hillshade Add solar analysis (day 100) Animation

VI. Animation

In this step, we

  1. What are the benefits and drawbacks of using DSM vs. Obj ?
  2. How do you think 3D modeling, rendering, animation and Web3D can help your work ?
  3. What additional types of textures, animations, GIS data, or interactions you can think of ?
  4. Whether and how you would use blender in your project if you knew about it earlier in the semester (maybe we can help you)?
⚠️ **GitHub.com Fallback** ⚠️