Package ca.eandb.jmist.framework

Examples of ca.eandb.jmist.framework.BoundingBoxBuilder2


    for (int i = 0; i < components.length; i++) {
      this.insert(new Component(components[i]), null);
    }

    BoundingBoxBuilder2 builder = new BoundingBoxBuilder2();
    for (Component component : this.components) {
      builder.add(component.bound);
    }

    this.bound = builder.getBoundingBox();
    this.area = this.getArea();

  }
View Full Code Here


    /**
     * @param indices
     */
    public Component(int[] indices) {
      BoundingBoxBuilder2 builder = new BoundingBoxBuilder2();
      for (int i = 0; i < indices.length; i++) {
        builder.add(vertices.get(indices[i]));
      }

      this.indices = indices;
      this.bound = builder.getBoundingBox();
    }
View Full Code Here

    }

    triangleLookupGridSize = Math.max(1, 2 * (int) Math.sqrt(numTriangles));
    triangleLookup = new HashMap<Integer, IntegerArray>();

    BoundingBoxBuilder2 builder = new BoundingBoxBuilder2();

    for (Point2 p : texCoords) {
      builder.add(p);
    }
    texBoundingBox = builder.getBoundingBox();

    AffineMatrix2 T = texBoundingBox.toMatrix().inverse();

    for (int fi = 0, nf = faces.size(); fi < nf; fi++) {
      Face f = faces.get(fi);
      if (f.texIndices != null) {
        for (int tri = 0; tri < f.decomp.length; tri += 3) {
          Point2 a = T.times(texCoords.get(f.texIndices[f.decomp[tri]]));
          Point2 b = T.times(texCoords.get(f.texIndices[f.decomp[tri + 1]]));
          Point2 c = T.times(texCoords.get(f.texIndices[f.decomp[tri + 2]]));

          builder.reset();
          builder.add(a);
          builder.add(b);
          builder.add(c);

          Box2 bound = builder.getBoundingBox();

          int i0 = MathUtil.clamp((int) Math.floor(bound.minimumX() * (double) triangleLookupGridSize), 0, triangleLookupGridSize - 1);
          int i1 = MathUtil.clamp((int) Math.floor(bound.maximumX() * (double) triangleLookupGridSize), 0, triangleLookupGridSize - 1);
          int j0 = MathUtil.clamp((int) Math.floor(bound.minimumY() * (double) triangleLookupGridSize), 0, triangleLookupGridSize - 1);
          int j1 = MathUtil.clamp((int) Math.floor(bound.maximumY() * (double) triangleLookupGridSize), 0, triangleLookupGridSize - 1);
View Full Code Here

    for (int i = 0; i < gridSize; i++) {
      lookup[i] = new IntegerArray();
    }

    BoundingBoxBuilder2 builder = new BoundingBoxBuilder2();
    for (int i = 0; i < this.vertices.length; i++) {
      builder.add(this.vertices[i]);
    }

    this.boundingBox = builder.getBoundingBox();
    double yMin = boundingBox.minimumY();
    double yLen = boundingBox.lengthY();
    int n = this.vertices.length;
    double yScale = lookup.length;
View Full Code Here

TOP

Related Classes of ca.eandb.jmist.framework.BoundingBoxBuilder2

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.