keywords: glist, instance

Summary

This demonstration focuses on mechanisms added to the GLIST file to facilitate rapid scene development based on (1) randomly created populations of base objects and (2) variations in material attribution for those base objects. These two randomization mechanisms were introduced to help streamline the process of creating large populations of geometrically similar objects with defined sets of material variations. It should be noted that these two mechanisms can be used separately or in combination.

Note
These GLIST file features were added to DIRSIG in Release 4.6.

Randomized Base Geometry

This mechanism allows the user to specify a pool of "base geometry" objects that will be randomly selected from for each instance in the instance list. The different "base geometry" objects can be weighted to create populations that reflect different proportions. The user must still provide a list of instances (either static or dynamic) but the model will choose which "base geometry" is used with each instance based on the weightings. This mechanism can be used for a variety of applications, including:

  • Quickly populate a forest (the user supplies tree locations as static instances) so that the final forest reflects the supplied proportions of each tree species (provided as the set of "base geometry" objects).

  • Quickly populate a traffic pattern (the user supplies the vehicle tracks as dynamic instances) with many different types of cars. If a car of a certain make or type is more or less common, the base geometry weightings can be manipulated to reflect this.

Randomized Material Attribution

For a given "base geometry", it is many times desirable to have each instance reflect a different combination of material attributes for that "base geometry". The user must still provide a list of instances (either static or dynamic) but the model will choose which material attributes to apply to the "base geometry" for each instance based on a set of weightings. This mechanism can be used for a variety of applications, including:

  • Quickly introduce material variations within a forest of trees of a given species. For example, the weightings for the materials could be setup so that some percentage of all the instances get assigned "sick tree" material properties.

  • Quickly populate a traffic pattern with material variants of the same "base geometry". For example, each "Honda Civic" could be randomly assigned a different paint color from a pool of allowable colors. The weightings of those materials combination can be manipulated to reflect observed distributions (for example, "white" is perhaps more common than "black").

Instance Time Windows

This demo also uses instance time windows to enable/disable various objects as a function of time. This feature can be useful when objects are only present for fixed time windows. For example, a parking lot could be populated with a set of cars that are only present for specific time periods during the day.

Details

This demo utilizes both randomized base geometry selection and randomized attribution for those base geometries. In this case, we have constructed a grid of static instances. We want to randomly populate that grid with two different base geometries (in this case, "spheres" and "cones") and we want the object for each instance to be attributed with one of five different materials. How this is accomplished is described in detail below.

Randomized Base Geometry

The different base geometries are defined by creating multiple <basegeometry> elements within an <object> element. In this example, we reference external GLIST files that define either a "sphere" or a "cone".

Below is the sphere.glist file, which contains the primitive geometry configuration for a "sphere" that is attributed with material label 2000 (this material label will be important later):

<geometrylist>
  <object enabled="true">
    <basegeometry>
      <sphere>
        <matid>2000</matid>
        <radius>0.5</radius>
      </sphere>
    </basegeometry>
    <staticinstance/>
  </object>
</geometrylist>

Likewise, the cone.glist file defines a cone using the built-in primitive geometry facilities. Note that the "cone" is also attributed with material label 2000:

<geometrylist>
  <object enabled="true">
    <basegeometry>
      <curvedfrustum>
        <matid>2000</matid>
        <height>1</height>
        <bottom>
          <xwidth>1</xwidth>
          <ywidth>1</ywidth>
          <radius>0.5</radius>
        </bottom>
        <top>
          <radius>0</radius>
        </top>
      </curvedfrustum>
    </basegeometry>
    <staticinstance>
      <translation><point><x>0</x><y>0</y><z>-0.5</z></point></translation>
    </staticinstance>
  </object>
</geometrylist>

The next step is to create a scene that populates our grid of locations (each is a <staticinstance>) with one of these two base objects. Below is an example of how the two object GLIST files can be used as the "base geometry" for a new object:

  <object>
    <basegeometry weight="1.0">
      <glist><filename>sphere.glist</filename></glist>
    </basegeometry>
    <basegeometry weight="1.0">
      <glist><filename>cone.glist</filename></glist>
    </basegeometry>
    ...

The weight attribute is used to manipulate the relative proportion of that base geometry in the overall population.

Note
If the weight attribute is not include, the default weight is 1.
Important
The base geometry weight values are summed and normalized to produce the relative fractions of each base geometry in the overall population.

It should be noted that the user can specify any GLIST file as the base geometry. In this case, all the base geometry GLIST files contain simple geometry primitives, however these GLIST files can contain facetized objects defined in OBJ or GDB format files.

Note
To add another base geometry, the user just needs to add another <basegeometry> to the <object> section.

Randomized Material Attribution

The ability to randomly reassign material properties to each instance is performed via the <population> element within an <object> element. The <materialvariant> element defines which original material label will be reassigned and the weighted distribution of assignable material labels.

In the example below, the model looks for surfaces attributed with material label 2000. These surfaces will be reassigned either material label 2001, 2002, 2003, 2004 or 2005 based on the respective weight for each label. In this case, each label is equally weighted so each of those five materials is equally likely to be assigned.

    <population>
      <materialvariant>
        <variantid>2000</variantid>
        <distribution>
          <matid weight="1">2001</matid>
          <matid weight="1">2002</matid>
          <matid weight="1">2003</matid>
          <matid weight="1">2004</matid>
          <matid weight="1">2005</matid>
        </distribution>
      </materialvariant>
    </population>
Note
If the weight attribute is not include, the default weight is 1.
Important
The material label weight values are summed and normalized to produce the relative fractions of material label in the overall population.

It should be noted that this simple demo focuses on objects (the "sphere" and "cone" primitives) that were assigned a single material label. This material reassignment technique can be applied to objects that have many material labels. Furthermore, the user has control over which material labels are reassigned. For example, the base geometry might be a "car" that has "glass" material applied to the windows, "chrome" to the bumpers and "rubber" to the tires. The material reassignment outlined here might change only the material assigned to the "body" of the car.

Note
To reassign another material label, the user just needs to add another <materialvariant> element within the <population> element.

Combining Random Base Geometry and Attribution

The demo.glist file actually combines these two mechanisms:

  1. It defines a grid of locations via the <staticinstance> description.

  2. That grid is then populated with either "sphere" or "cone" base geometry objects. Both of these objects start out with material label 2000 assigned to them (see the respective sphere.glist and cone.glist files):

    1. In this example, the weightings for the "sphere" and "cone" objects are equal, so we expect to see an equal distribution of these geometries in the grid.

  3. Whatever base geometry is randomly selected for each instance is then reassigned materials based on a define population of material labels:

    1. In this example, there are five equally weighted materials, so we expect to see an equal distribution of these materials in the grid.

Using Instance Time Windows

This demo also uses instance time windows to enable/disable various objects as a function of time. The grid of static instances was produced using the simple C++ program make_instances.cpp, which simply computes a grid of instance locations and assigns each instance a unique 6 second enabled time window using the "daily" time windows option. An example of the static instances and their respective time windows is shown below:

    <staticinstance timewindow="[12:00:1.05197,12:00:4.05197]"><translation><point><x>-50</x><y>-50</y><z>0.5</z></point></translation></staticinstance>
    <staticinstance timewindow="[12:00:0,12:00:0.0871907]"><translation><point><x>-50</x><y>-48</y><z>0.5</z></point></translation></staticinstance>
    ...
    <staticinstance timewindow="[12:00:0,12:00:2.96057]"><translation><point><x>-50</x><y>-46</y><z>0.5</z></point></translation></staticinstance>

Note that the local time in the tasks file is a key input in this simulation. Depending on the time that the scene is imaged, a different set of objects will be enabled. Since all the time windows to enable objects are close to the 12:00 time and are only a few seconds in duration, simulating at 13:00 (for example) would yield an empty scene.

Important Files

The following files are considered important to this demo:

  • The sphere.glist and cone.glist files define the two base geometry objects used in this scene.

  • The demo.glist file defines the grid of static instances and randomly places either "sphere" or a "cone" at each instance (grid) location. Furthermore, it randomly attributes the chosen object with different materials.

Setup

This simulation consists of a 2D framing camera mounted to a platform that is statically positioned to look at a portion of the scene from a slant angle. The user simply runs the simulation to visualize the how the scene is populated based on the randomized base geometry selection and randomized material attribution. The user only needs to rerun DIRSIG to observe changes to the set of random base geometries (for example, if a "box" is added), changes to the weightings of the base geometries, the addition of a new material to the assignment list or changes to the weightings of the materials.

images/demo.png
Figure 1. Output of the simulation using 2% scaling.