Examples of VectorXYZ


Examples of org.osm2world.core.math.VectorXYZ

    Collection<TriangleXYZ> trianglesXYZ =
        new ArrayList<TriangleXYZ>(trianglesXZ.size());
   
    for (TriangleXZ triangleXZ : trianglesXZ) {
     
      VectorXYZ v1 = getPosXYZ(triangleXZ.v1);
      VectorXYZ v2 = getPosXYZ(triangleXZ.v2);
      VectorXYZ v3 = getPosXYZ(triangleXZ.v3);
     
      if (triangleXZ.isClockwise()) { //TODO: ccw test should not be in here, but maybe in triangulation util
        trianglesXYZ.add(new TriangleXYZ(v3, v2, v1));
      } else  {
        trianglesXYZ.add(new TriangleXYZ(v1, v2, v3));
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

   
    for (TriangleXYZ triangle : triangles) {
     
      if (reconstructFaces()) {
       
        VectorXYZ n = triangle.getNormal();
       
        if (Double.isNaN(n.x) || Double.isNaN(n.y) || Double.isNaN(n.z)) {
          continue; //TODO log
        }
       
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

public class FaceTargetTest {

  @Test
  public void testCombineTrianglesToFaces() {
   
    VectorXYZ bottomLeft = new VectorXYZ(-1, 0, 0);
    VectorXYZ bottomCenter = new VectorXYZ(0, 0, 0);
    VectorXYZ bottomRight = new VectorXYZ(+1, 0, 0);
    VectorXYZ centerLeft = new VectorXYZ(-1, 1, 0);
    VectorXYZ center = new VectorXYZ(0, 1, 0);
    VectorXYZ centerRight = new VectorXYZ(+1, 1, 0);
    VectorXYZ topCenter = new VectorXYZ(0, 2, 0);
   
    List<IsolatedTriangle> isolatedTriangles = new ArrayList<IsolatedTriangle>();
   
    isolatedTriangles.add(triangle(centerLeft, bottomLeft, center));
    isolatedTriangles.add(triangle(bottomLeft, bottomCenter, center));
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

    Iterator<VectorXZ> itr2 = texCoordList.iterator();
   
    while (itr1.hasNext()) {
   
      TriangleXYZWithNormals triangle = itr1.next();
      VectorXYZ n1 = triangle.n1;
      VectorXYZ n2 = triangle.n2;
      VectorXYZ n3 = triangle.n3;
      VectorXZ tex1 = itr2.next();
      VectorXZ tex2 = itr2.next();
      VectorXZ tex3 = itr2.next();
     
      append(INDENT);
   
      if (depth > 0) {
     
        VectorXYZ d1 = n1.mult(depth*SMALL_OFFSET);
        VectorXYZ d2 = n2.mult(depth*SMALL_OFFSET);
        VectorXYZ d3 = n3.mult(depth*SMALL_OFFSET);
       
        appendTriangle(
            triangle.v1.add(d1),
            triangle.v2.add(d2),
            triangle.v3.add(d3),
 
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

    Iterator<VectorXZ> itr2 = texCoordList.iterator();
   
    while (itr1.hasNext()) {
   
      TriangleXYZ triangle = itr1.next();
      VectorXYZ normal = triangle.getNormal();
      VectorXZ tex1 = itr2.next();
      VectorXZ tex2 = itr2.next();
      VectorXZ tex3 = itr2.next();
   
      append(INDENT);
   
      if (depth > 0) {
     
        normal = normal.mult(depth*SMALL_OFFSET);
        appendTriangle(
            triangle.v1.add(normal),
            triangle.v2.add(normal),
            triangle.v3.add(normal),
            null, null, null, tex1, tex2, tex3, false, true);
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

    return result;
  }
 
  private boolean isDegenerated(TriangleXYZ triangle) {

    VectorXYZ a = triangle.v1;
    VectorXYZ b = triangle.v2;
    VectorXYZ c = triangle.v3;
   
    if (a.equals(b) || a.equals(c) || b.equals(c)) {
      return true;
    } else if (a.x == b.x && b.x == c.x
        && a.y == b.y && b.y == c.y) {
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

              faceVector, height-0.2, width-0.06, width-0.06);
          target.drawBox(roofMaterial,
              getBase().addY(height-0.2),
              faceVector, 0.2, width, width);
          target.drawBox(poleMaterial,
              getBase().add(new VectorXYZ((width/2-0.05),0, (width/2-0.05) ).rotateY( directionAngle )),
              faceVector, height-0.2, 0.1, 0.1);
          target.drawBox(poleMaterial,
              getBase().add(new VectorXYZ(-(width/2-0.05),0, (width/2-0.05) ).rotateY( directionAngle )),
              faceVector, height-0.2, 0.1, 0.1);
          target.drawBox(poleMaterial,
              getBase().add(new VectorXYZ(0,0, -(width/2-0.05) ).rotateY( directionAngle )),
              faceVector, height-0.2, width, 0.1);
         
          break;
        default:
          assert false : "unknown or unsupported phone type";
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

          break;
        case PILLAR:
          height = parseHeight(node.getTags(), 1.8f);
         
          target.drawBox(poleMaterial,
              getBase().add(new VectorXYZ(0,0, -0.05).rotateY(faceVector.angle())),
              faceVector, height-0.3, 0.1, 0.1);
          target.drawBox(machineMaterial,
              getBase().addY(height-1).add(new VectorXYZ(0,0, 0.1 ).rotateY(directionAngle)),
              faceVector, 1, 1, 0.2);
         
          break;
        default:
          assert false : "unknown or unsupported Vending machine Type";
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

  public void setCamera(double posX, double posY, double posZ,
      double lookAtX, double lookAtY, double lookAtZ,
      double upX, double upY, double upZ) {
    setPos(posX, posY, posZ);
    up = new VectorXYZ(upX, upY, upZ);
    setLookAt(lookAtX, lookAtY, lookAtZ);
  }
View Full Code Here

Examples of org.osm2world.core.math.VectorXYZ

    up = new VectorXYZ(upX, upY, upZ);
    setLookAt(lookAtX, lookAtY, lookAtZ);
  }

  private void setPos(double x, double y, double z) {
    this.setPos(new VectorXYZ(x, y, z));
  }
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.