Package ca.eandb.jmist.framework.geometry.primitive

Examples of ca.eandb.jmist.framework.geometry.primitive.PolyhedronGeometry


          break;

        }
      } while (gc != 0);

      PolyhedronGeometry mesh = null;

      if (state.currentSection.equals("ENTITIES")) {
        if (state._3dfaces == null) {
          state._3dfaces = new PolyhedronGeometry();
          state.root.addChild(state._3dfaces);
        }
        mesh = state._3dfaces;
      } else if (state.currentBlock != null) {
        if (state.currentBlock._3dfaces == null) {
          state.currentBlock._3dfaces = new PolyhedronGeometry();
          state.currentBlock.geometry.addChild(state.currentBlock._3dfaces);
        }
        mesh = state.currentBlock._3dfaces;
      } else {
        return;
      }

      Point3[] vertices = new Point3[4];
      for (int i = 0; i < 4; i++) {
        vertices[i] = new Point3(v[3 * i + 0], v[3 * i + 1], v[3 * i + 2]);
      }

      int nv = vertices[3].squaredDistanceTo(vertices[2]) < MathUtil.EPSILON ? 3 : 4;
      int offset = mesh.getNumVertices();

      for (int i = 0; i < nv; i++) {
        mesh.addVertex(vertices[i]);
      }

      mesh.addFace(new int[]{ offset + 0, offset + 1, offset + 2 });
      if (nv > 3) { // quad
        mesh.addFace(new int[]{ offset + 2, offset + 3, offset + 0 });
      }

    }
View Full Code Here


          break;
        }
      } while (elem.getGroupCode() != 0);

      if ((flags & 64) != 0) {
        state.currentMesh = new PolyhedronGeometry();
        if (state.currentBlock != null) {
          state.currentBlock.geometry.addChild(state.currentMesh);
        }
        if (state.currentSection.equals("ENTITIES")) {
          state.root.addChild(state.currentMesh);
View Full Code Here

    }
    int[][] fs = new int[faces.size()][];
    for (int i = 0; i < fs.length; i++) {
      fs[i] = faces.get(i).vertexIndex.toIntegerArray();
    }
    return new PolyhedronGeometry(vs, fs);
  }
View Full Code Here

TOP

Related Classes of ca.eandb.jmist.framework.geometry.primitive.PolyhedronGeometry

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.