Package org.osm2world.core.math

Examples of org.osm2world.core.math.VectorXZ


    double height = Double.parseDouble(
        JOptionPane.showInputDialog(viewerFrame, "height"));
   
    MapProjection projection = data.getConversionResults().getMapProjection();

    VectorXZ newPosXZ = projection.calcPos(lat, lon);
    VectorXYZ newPos = newPosXZ.xyz(height);
   
    renderOptions.camera.move(newPos.subtract(renderOptions.camera.getPos()));
   
  }
View Full Code Here


          height,
          0.15, 0.15, false, true);
     
      /* draw two small and one large valve */
      VectorXYZ valveBaseVector = getBase().addY(height - 0.3);
      VectorXZ smallValveVector = VectorXZ.X_UNIT;
      VectorXZ largeValveVector = VectorXZ.Z_UNIT;
     
      target.drawBox(FIREHYDRANT,
        valveBaseVector,
        smallValveVector, 0.1f, 0.5f, 0.1f);
      target.drawBox(FIREHYDRANT,
View Full Code Here

   
    for (int i = 0; i < vertices.size(); i++) {
     
      if (texCoordLists != null) {
        for (int texLayer = 0; texLayer < texCoordLists.size(); texLayer++) {
          VectorXZ textureCoord =  texCoordLists.get(texLayer).get(i);
          gl.glMultiTexCoord2d(getGLTextureConstant(texLayer),
              textureCoord.x, textureCoord.z);
        }
      }
     
View Full Code Here

  }
 
  private static final AxisAlignedBoundingBoxXZ boundsForTile(
      MapProjection mapProjection, TileNumber tile) {
   
    VectorXZ tilePos1 = mapProjection.calcPos(
        tile2lat(tile.y, tile.zoom), tile2lon(tile.x, tile.zoom));
 
    VectorXZ tilePos2 = mapProjection.calcPos(
        tile2lat(tile.y+1, tile.zoom), tile2lon(tile.x+1, tile.zoom));
   
    return new AxisAlignedBoundingBoxXZ(Arrays.asList(tilePos1, tilePos2));
   
  }
View Full Code Here

   
    @Override
    public void renderTo(Target<?> target) {
     
      double directionAngle = parseDirection(node.getTags(), PI);
      VectorXZ faceVector = VectorXZ.fromAngle(directionAngle);
      target.drawColumn(WOOD, null,
          getBase(),
          1.5, 0.05, 0.05, false, true);
      target.drawBox(WOOD,
          getBase().addY(1.2),
View Full Code Here

      if (way.getTags().contains("power", "line")) {
        powerLines.add(way);
      }
    }

    VectorXZ dir = VectorXZ.NULL_VECTOR;
    int cables = -1;
    int voltage = -1;
    for (MapWaySegment powerLine : powerLines) {
      dir = dir.add(powerLine.getDirection());
     
      try {
        cables = Integer.valueOf(powerLine.getTags().getValue("cables"));
      } catch (NumberFormatException e) {}
      try {
        voltage = Integer.valueOf(powerLine.getTags().getValue("voltage"));
      } catch (NumberFormatException e) {}
    }
    dir = dir.mult(1.0/powerLines.size());

    return new TowerConfig(node, cables, voltage, dir);
  }
View Full Code Here

   
    @Override
    public void renderTo(Target<?> target) {
     
      double directionAngle = parseDirection(node.getTags(), PI);
      VectorXZ faceVector = VectorXZ.fromAngle(directionAngle);
           
      target.drawBox(PLASTIC_GREY, getBase(),
          faceVector, 1.5, 0.8, 0.3);
     
    }
View Full Code Here

          getBase(),
          poleHeight,
          poleRadiusBottom, poleRadiusTop, false, false);
     
      /* draw nacelle */
      VectorXZ nacelleVector = VectorXZ.X_UNIT;
      target.drawBox(nacelleMaterial,
          getBase().addY(poleHeight).add(nacelleDepth/2 - poleRadiusTop*2, 0f, 0f),
          nacelleVector, nacelleHeight, nacelleHeight, nacelleDepth);
     
      /* draw blades */
 
View Full Code Here

       
        double lenToEnd = end.distanceToXZ(start);
        double heightDiff = end.y - start.y;

        double stepSize = lenToEnd / INTERPOLATION_STEPS;
        VectorXZ dir = end.xz().subtract(start.xz()).normalize();
       
        List<VectorXYZ> path = new ArrayList<VectorXYZ>();
        for (int x = 0; x <= INTERPOLATION_STEPS; x++) {
          double ratio = x / INTERPOLATION_STEPS;
         
          // distance from start to position x
          double dx = stepSize * x;
         
          // use a simple parabola between two towers
          double height = (1 - Math.pow(2.0*(ratio - 0.5), 2)) * -SLACK_SPAN;
          // add a linear function to account for different tower/terrain heights
          height += ratio * heightDiff;
         
          path.add(start.add(dir.mult(dx)).add(0, height, 0));
        }
       
        List<List<VectorXYZ>> strips = createShapeExtrusionAlong(
            powerlineShape, path,
            nCopies(path.size(), VectorXYZ.Y_UNIT));
View Full Code Here

      this.maxX = maxX2;
      this.minZ = minZ2;
      this.maxZ = maxZ2;
     
      List<VectorXZ> vertices = new ArrayList<VectorXZ>(5);
      vertices.add(new VectorXZ(minX2, minZ2));
      vertices.add(new VectorXZ(maxX2, minZ2));
      vertices.add(new VectorXZ(maxX2, maxZ2));
      vertices.add(new VectorXZ(minX2, maxZ2));
      vertices.add(vertices.get(0));
      boundary = new SimplePolygonXZ(vertices);
     
    }
View Full Code Here

TOP

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

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.