Examples of VectorXYZ


Examples of org.osm2world.core.math.VectorXYZ

      double width=1;
      double height=0.1;
     
      List<VectorXYZ> wallShape = asList(
          new VectorXYZ(-width/2, 0, 0),
          new VectorXYZ(-width/2, height, 0),
          new VectorXYZ(+width/2, height, 0),
          new VectorXYZ(+width/2, 0, 0)
      );

      List<VectorXYZ> path = getOutlinePolygon().getVertexLoop();
     
      List<List<VectorXYZ>> strips = createShapeExtrusionAlong(
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

  @Test
  public final void testCalculateTriangleStripNormals() {
   
    List<VectorXYZ> vs = asList(
        NULL_VECTOR,
        new VectorXYZ(1, 0, -1),
        new VectorXYZ(1, 0, 0),
        new VectorXYZ(1, 1, 0)
        );
   
    List<VectorXYZ> normals =
        NormalCalculationUtil.calculateTriangleStripNormals(vs, true);
   
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

  @Test
  public final void testCalculateTriangleFanNormals() {
   
    List<VectorXYZ> vs = asList(
        NULL_VECTOR,
        new VectorXYZ(1, 0, -1),
        new VectorXYZ(1, 0, 0),
        new VectorXYZ(1, 1, 0)
        );
   
    List<VectorXYZ> normals =
        NormalCalculationUtil.calculateTriangleFanNormals(vs, true);
   
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

  @Test
  public final void testCalculateTriangleStripNormals() {
   
    List<VectorXYZ> vs = asList(
        NULL_VECTOR,
        new VectorXYZ(1, 0, -1),
        new VectorXYZ(1, 0, 0),
        new VectorXYZ(1, 1, 0)
        );
   
    List<VectorXYZ> normals =
        NormalCalculationUtil.calculateTriangleStripNormals(vs, true);
   
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

  @Test
  public final void testCalculateTriangleFanNormals() {
   
    List<VectorXYZ> vs = asList(
        NULL_VECTOR,
        new VectorXYZ(1, 0, -1),
        new VectorXYZ(1, 0, 0),
        new VectorXYZ(1, 1, 0)
        );
   
    List<VectorXYZ> normals =
        NormalCalculationUtil.calculateTriangleFanNormals(vs, true);
   
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

  @Override
  public void drawBox(Material material,
      VectorXYZ bottomCenter, VectorXZ faceDirection,
      double height, double width, double depth) {
   
    final VectorXYZ backVector = faceDirection.mult(-depth).xyz(0);
    final VectorXYZ rightVector = faceDirection.rightNormal().mult(-width).xyz(0);
    final VectorXYZ upVector = new VectorXYZ(0, height, 0);
   
    final VectorXYZ frontLowerLeft = bottomCenter
        .add(rightVector.mult(-0.5))
        .add(backVector.mult(-0.5));
   
    final VectorXYZ frontLowerRight = frontLowerLeft.add(rightVector);
    final VectorXYZ frontUpperLeft  = frontLowerLeft.add(upVector);
    final VectorXYZ frontUpperRight = frontLowerRight.add(upVector);
   
    final VectorXYZ backLowerLeft   = frontLowerLeft.add(backVector);
    final VectorXYZ backLowerRight  = frontLowerRight.add(backVector);
    final VectorXYZ backUpperLeft   = frontUpperLeft.add(backVector);
    final VectorXYZ backUpperRight  = frontUpperRight.add(backVector);
   
    List<VectorXYZ> vsStrip1 = asList(
        backLowerLeft, backLowerRight,
        frontLowerLeft, frontLowerRight,
        frontUpperLeft, frontUpperRight,
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

     
      double angle = - i * angleInterval;
      double sin = Math.sin(angle);
      double cos = Math.cos(angle);
     
      VectorXYZ topV = base.add(
          radiusTop * sin, height, radiusTop * cos);
      VectorXYZ bottomV = base.add(
          radiusBottom * sin, 0, radiusBottom * cos);

      bottomFan.add(bottomV);
      topFan.add(topV);

 
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

   
    final double posDistance = pos.subtract(startPos).length();

    // find points with known elevation directly before and after pos

    VectorXYZ before = null;
    VectorXYZ after = null;

    double beforeDistance = 0;
    double afterDistance = 0;

    for (VectorXYZ v : pointsWithEle) {
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

      sumX += v.x;
      sumY += v.y;
      sumZ += v.z;
    }
   
    return new VectorXYZ(sumX / p.primitive.vertices.size(),
        sumY / p.primitive.vertices.size(),
        sumZ / p.primitive.vertices.size());
   
  }
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

   
    Collection<TriangleXYZ> trianglesXYZ =
      new ArrayList<TriangleXYZ>(trianglesXZ.size());
   
    for (TriangleXZ triangleXZ : trianglesXZ) {
      VectorXYZ v1 = connectors.getPosXYZ(triangleXZ.v1);
      VectorXYZ v2 = connectors.getPosXYZ(triangleXZ.v2);
      VectorXYZ v3 = connectors.getPosXYZ(triangleXZ.v3);
      if (triangleXZ.isClockwise()) {
        trianglesXYZ.add(new TriangleXYZ(v3, v2, v1));
      } else  {
        trianglesXYZ.add(new TriangleXYZ(v1, v2, v3));
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.