Package org.osm2world.core.math

Examples of org.osm2world.core.math.VectorXYZ


   * rotates the camera around the pitch axis
   *
   * @param d  angle in radians
   */
  public void pitch(double d) {
    VectorXYZ right = getRight();
   
    up = up.rotateVec(d, right);
   
    VectorXYZ toOldLookAt = lookAt.subtract(pos);
    VectorXYZ toNewLookAt = toOldLookAt.rotateVec(d, right);
    lookAt = pos.add(toNewLookAt);
  }
View Full Code Here


   *
   * @param d  angle in radians
   */
  public void mapPitch(double d) {
   
    VectorXYZ right = getViewDirection().crossNormalized(Y_UNIT);
   
    up = up.rotateVec(d, right);
   
    VectorXYZ toOldLookAt = lookAt.subtract(pos);
    VectorXYZ toNewLookAt = toOldLookAt.rotateVec(d, right);
    lookAt = pos.add(toNewLookAt);
  }
View Full Code Here

        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

          gl.glMultiTexCoord2d(getGLTextureConstant(texLayer),
              textureCoord.x, textureCoord.z);
        }
      }
     
      VectorXYZ n = normals.get(i);
      gl.glNormal3d(n.x, n.y,  -n.z);
     
      VectorXYZ v = vertices.get(i);
      gl.glVertex3d(v.x, v.y, -v.z);
     
    }
   
    gl.glEnd();
View Full Code Here

          getBase(),
          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,
        valveBaseVector.add(0.2f, -0.1f, 0f),
        largeValveVector, 0.15f, 0.15f, 0.15f);
    }
View Full Code Here

 
  static final void applyCameraMatrices(GL2 gl, Camera camera) {
   
      gl.glLoadIdentity();
   
    VectorXYZ pos = camera.getPos();
    VectorXYZ lookAt = camera.getLookAt();
    VectorXYZ up = camera.getUp();
    new GLU().gluLookAt(
        pos.x, pos.y, -pos.z,
        lookAt.x, lookAt.y, -lookAt.z,
        up.x, up.y, -up.z);
   
View Full Code Here

  @Override
  public void actionPerformed(ActionEvent arg0) {
   
    MapProjection mapProjection = data.getConversionResults().getMapProjection();
   
    VectorXYZ pos = renderOptions.camera.getPos();
    VectorXYZ lookAt = renderOptions.camera.getLookAt();
   
    JOptionPane.showMessageDialog(null,
        "posLat = " + mapProjection.calcLat(pos.xz())
        + "\nposLon = " + mapProjection.calcLon(pos.xz())
        + "\nposEle = " + pos.y
        + "\nlookAtLat = " + mapProjection.calcLat(lookAt.xz())
        + "\nlookAtLon = " + mapProjection.calcLon(lookAt.xz())
        + "\nlookAtEle = " + lookAt.y,
        "Current camera configuration", JOptionPane.INFORMATION_MESSAGE);
  }
View Full Code Here

      AxisAlignedBoundingBoxXZ bounds, double angleDeg,
      CardinalDirection from) {
   
    Camera result = new Camera();
   
    VectorXYZ lookAt = new VectorXYZ(
        bounds.minX + bounds.sizeX() / 2,
        0,
        bounds.minZ + bounds.sizeZ() / 2);
   
    // calculate camera position (start with position for view from south,
View Full Code Here

   
    @Override
    public void renderTo(Target<?> target) {
     
      List<VectorXYZ> powerlineShape = asList(
        new VectorXYZ(-DEFAULT_THICKN/2, DEFAULT_CLEARING_BL, 0),
        new VectorXYZ(-DEFAULT_THICKN/2, DEFAULT_CLEARING_BL + DEFAULT_THICKN, 0),
        new VectorXYZ(+DEFAULT_THICKN/2, DEFAULT_CLEARING_BL + DEFAULT_THICKN, 0),
        new VectorXYZ(+DEFAULT_THICKN/2, DEFAULT_CLEARING_BL, 0)
      );
     
      List<VectorXYZ> path = getBaseline();
     
      List<List<VectorXYZ>> strips = createShapeExtrusionAlong(
View Full Code Here

        // normal PowerTower...

        double startHeight = parseHeight(start.pos.getTags(), 14) + 0.25;
        double endHeight = parseHeight(end.pos.getTags(), 14) + 0.25;
       
        VectorXYZ baseStart = getStartXYZ().addY(startHeight - 0.5);
        VectorXYZ baseEnd = getEndXYZ().addY(endHeight - 0.5);
     
        // power lines at the top left and right
        addPos(baseStart, baseEnd, 2, 0.5);
        addPos(baseStart, baseEnd, -2, 0.5);
       
        if (cables >= 3) {
          // additional power line at the top center
          addPos(baseStart, baseEnd, 0, 0.5);
        }
        if (cables >= 5) {
          // further power lines at the left and right below the column
          addPos(baseStart, baseEnd, 1.5, -0.5);
          addPos(baseStart, baseEnd, -1.5, -0.5);
        }
      } else {

        // High voltage PowerTower ...
       
        float default_height = voltage > 150000 ? 40 : 30;
        float pole_width = voltage > 150000 ? 16 : 13;
       
        double startHeight = parseHeight(start.pos.getTags(), default_height);
        double endHeight = parseHeight(end.pos.getTags(), default_height);

        double heightS = 2.5 * (((int) (startHeight / 2.5)) / 5);
        double heightE = 2.5 * (((int) (endHeight / 2.5)) / 5);

        VectorXYZ baseStart = getStartXYZ().addY(-0.5);
        VectorXYZ baseEnd = getEndXYZ().addY(-0.5);

        // power line at the tower's top
        addPos(baseStart, baseEnd, 0, 5*heightS, 5*heightE);

        // power lines start a little bit below the tower's columns
        baseStart = baseStart.add(0, -0.2, 0);
        baseEnd = baseEnd.add(0, -0.2, 0);

        // power lines at the base column
        addPos(baseStart, baseEnd, 0.9*pole_width, startHeight/2, endHeight/2);
        addPos(baseStart, baseEnd, -0.9*pole_width, startHeight/2, endHeight/2);
        if ((cables > 3) && (cables <= 9)) {
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.