Package org.osm2world.core.math

Examples of org.osm2world.core.math.VectorXYZ


    @Override
    public void requireSmoothness(
        EleConnector from, EleConnector via, EleConnector to) {
     
      VectorXYZ v = via.getPosXYZ();
     
      VectorXYZ vToFrom = from.getPosXYZ().subtract(v).normalize();
      VectorXYZ vToTo = to.getPosXYZ().subtract(v).normalize();
     
      target.drawLineStrip(SMOOTHNESS, 3,
          v.add(vToFrom.mult(2)),
          v,
          v.add(vToTo.mult(2)));
     
    }
View Full Code Here


       
      }
     
      /* draw the entrance as a box protruding from the building */
     
      VectorXYZ center = connector.getPosXYZ();
     
      float height = parseHeight(node.getTags(), 2);
      float width = parseWidth(node.getTags(), 1);
     
      target.drawBox(Materials.ENTRANCE_DEFAULT,
View Full Code Here

      List<VectorXYZ> aboveRightOutline =
        new ArrayList<VectorXYZ>(rightOutline.size());
     
      for (int i=0; i < leftOutline.size(); i++) {
     
        VectorXYZ clearingOffset = VectorXYZ.Y_UNIT.mult(
            10); //TODO restore clearing
//            primaryRep.getClearingAbove(leftOutline.get(i).xz()));
       
        aboveLeftOutline.add(leftOutline.get(i).add(clearingOffset));
        aboveRightOutline.add(rightOutline.get(i).add(clearingOffset));
View Full Code Here

          accumulatedLength += coord.distanceTo(vertices.get(i-1));
        }
       
        /* add wall vectors */
       
        final VectorXYZ upperVector = coord.xyz(roof.getRoofEleAt(coord));
        final VectorXYZ middleVector = coord.xyz(baseEle + heightWithoutRoof);
       
        double upperEle = upperVector.y;
        double middleEle = middleVector.y;
       
        mainWallVectors.add(middleVector);
        mainWallVectors.add(new VectorXYZ(coord.x,
            min(floorEle, middleEle), coord.z));
       
        roofWallVectors.add(upperVector);
        roofWallVectors.add(new VectorXYZ(coord.x,
            min(middleEle, upperEle), coord.z));
       
       
        /* add texture coordinates */
       
 
View Full Code Here

    VectorXYZ[] result = new VectorXYZ[baseLine.size() * 2];

    for (int i = 0; i < baseLine.size(); i++) {

      VectorXYZ basePos = baseLine.get(i);
     
      result[i*2] = new VectorXYZ(
          basePos.getX(),
          basePos.getY() + stripLowerYBound,
          basePos.getZ());

      result[i*2+1] = new VectorXYZ(
          basePos.getX(),
          basePos.getY() + stripUpperYBound,
          basePos.getZ());

    }
   
    return asList(result);
   
View Full Code Here

        extrusionPath.get(1).subtract(extrusionPath.get(0)).normalize(),
        upVectors.get(0));
   
    for (int pathI = 1; pathI < extrusionPath.size()-1; pathI ++) {
           
      VectorXYZ forwardVector =
        extrusionPath.get(pathI+1).subtract(extrusionPath.get(pathI-1));
      forwardVector = forwardVector.normalize();
     
      shapeVectors[pathI] = transformShape(shape,
          extrusionPath.get(pathI),
          forwardVector,
          upVectors.get(pathI));
View Full Code Here

  public static final List<VectorXYZ> transformShape (List<VectorXYZ> shape,
      VectorXYZ center, VectorXYZ forward, VectorXYZ up) {

    VectorXYZ[] result = new VectorXYZ[shape.size()];
   
    VectorXYZ right = forward.cross(up);
   
    final double[][] m = { //rotation matrix
        {right.x,   right.y,   right.z},
        {up.x,      up.y,      up.z},
        {forward.x, forward.y, forward.z}
    };
   
    for (int i = 0; i < shape.size(); i++) {
     
      VectorXYZ v = shape.get(i);
 
      v = new VectorXYZ(
          m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
          m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z,
          m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z
          );
     
      v = v.add(center);
     
      result[i] = v;
     
    }
   
View Full Code Here

      double width, double height,
      boolean mirroredTextures) {

    double halfWidth = 0.5 * width;
   
    VectorXYZ xPosBottom = pos.add(halfWidth, 0, 0);
    VectorXYZ xNegBottom = pos.add(-halfWidth, 0, 0);
    VectorXYZ zPosBottom = pos.add(0, 0, halfWidth);
    VectorXYZ zNegBottom = pos.add(0, 0, -halfWidth);

    VectorXYZ xPosTop = xPosBottom.add(0, height, 0);
    VectorXYZ xNegTop = xNegBottom.add(0, height, 0);
    VectorXYZ zPosTop = zPosBottom.add(0, height, 0);
    VectorXYZ zNegTop = zNegBottom.add(0, height, 0);
    VectorXYZ posTop = pos.add(0, height, 0);
   
    target.drawTriangleStrip(material, asList(
        xNegTop, xNegBottom, posTop, pos),
        buildBillboardTexCoordLists(false, mirroredTextures,
            material.getTextureDataList().size()));
View Full Code Here

            + insertCount);
       
        double x = (random.nextDouble() * 2 * SIZE) - SIZE;
        double z = (random.nextDouble() * 2 * SIZE) - SIZE;
       
        VectorXYZ point = new VectorXYZ(x, 0, z);
       
        points.add(point);
       
        // check whether undoing works
       
        triangulation2.probe(point.xz());
       
        assertTriangulationsEqual(triangulation, triangulation2);
       
        // insert for real
       
View Full Code Here

TOP

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

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.