Package org.osm2world.core.math

Examples of org.osm2world.core.math.VectorGridXZ


      }
      }
     
      /* add a grid of points within the area for smoother surface shapes */
     
      VectorGridXZ pointGrid = new VectorGridXZ(
          area.getAxisAlignedBoundingBoxXZ(),
          EmptyTerrainBuilder.POINT_GRID_DIST);
     
      for (VectorXZ point : pointGrid) {
       
View Full Code Here


   * as mapped areas later on to avoid unnecessary special case handling.
   */
  static void createAreasForEmptyTerrain(List<MapNode> mapNodes,
      List<MapArea> mapAreas, AxisAlignedBoundingBoxXZ dataBounds) {
   
    VectorGridXZ posGrid = new VectorGridXZ(
        dataBounds.pad(POINT_GRID_DIST), POINT_GRID_DIST);
   
    /* create a grid of nodes (leaving points within the future patches blank) */
   
    MapNode[][] nodeGrid = new MapNode[posGrid.sizeX()][posGrid.sizeZ()];
   
    for (int x = 0; x < posGrid.sizeX(); x++) {
      for (int z = 0; z < posGrid.sizeZ(); z++) {
       
        if (x % PATCH_SIZE_POINTS == 0 || x == posGrid.sizeX() - 1
            || z % PATCH_SIZE_POINTS == 0 || z == posGrid.sizeZ() - 1) {
         
          VectorXZ pos = posGrid.get(x, z);
         
          MapNode mapNode = new MapNode(pos, EMPTY_SURFACE_NODE);
         
          nodeGrid[x][z] = mapNode;
          mapNodes.add(mapNode);
View Full Code Here

      TerrainInterpolator strategy = buildInterpolator();
      strategy.setKnownSites(sites);
     
      AxisAlignedBoundingBoxXZ bound = map.getDataBoundary();
     
      VectorGridXZ sampleGrid = new VectorGridXZ(bound, SAMPLE_DIST);
     
      VectorXYZ[][] samples = new VectorXYZ[sampleGrid.sizeX()][sampleGrid.sizeZ()];
     
      long startTimeMillis = System.currentTimeMillis();
     
      for (int x = 0; x < sampleGrid.sizeX(); x++) {
        for (int z = 0; z < sampleGrid.sizeZ(); z++) {
         
          samples[x][z] = strategy.interpolateEle(sampleGrid.get(x, z));
                   
        }
       
        if (x % 100 == 0) {
          long finishedSamples = x * sampleGrid.sizeZ();
          System.out.println(finishedSamples + "/" + sampleGrid.size()
              + " after " + ((System.currentTimeMillis() - startTimeMillis) / 1000f));
        }
      }

      /* draw surface from samples */
 
View Full Code Here

TOP

Related Classes of org.osm2world.core.math.VectorGridXZ

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.