Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Point3.z()


      Point3 c = sphere.center();

      if (this.isEmpty()) {
        minimumX = c.x() - r;
        minimumY = c.y() - r;
        minimumZ = c.z() - r;
        maximumX = c.x() + r;
        maximumY = c.y() + r;
        maximumZ = c.z() + r;
      } else {
        minimumX = Math.min(c.x() - r, minimumX);
View Full Code Here


        minimumX = c.x() - r;
        minimumY = c.y() - r;
        minimumZ = c.z() - r;
        maximumX = c.x() + r;
        maximumY = c.y() + r;
        maximumZ = c.z() + r;
      } else {
        minimumX = Math.min(c.x() - r, minimumX);
        minimumY = Math.min(c.y() - r, minimumY);
        minimumZ = Math.min(c.z() - r, minimumZ);
        maximumX = Math.max(c.x() + r, maximumX);
View Full Code Here

        maximumY = c.y() + r;
        maximumZ = c.z() + r;
      } else {
        minimumX = Math.min(c.x() - r, minimumX);
        minimumY = Math.min(c.y() - r, minimumY);
        minimumZ = Math.min(c.z() - r, minimumZ);
        maximumX = Math.max(c.x() + r, maximumX);
        maximumY = Math.max(c.y() + r, maximumY);
        maximumZ = Math.max(c.z() + r, maximumZ);
      }
    }
View Full Code Here

        minimumX = Math.min(c.x() - r, minimumX);
        minimumY = Math.min(c.y() - r, minimumY);
        minimumZ = Math.min(c.z() - r, minimumZ);
        maximumX = Math.max(c.x() + r, maximumX);
        maximumY = Math.max(c.y() + r, maximumY);
        maximumZ = Math.max(c.z() + r, maximumZ);
      }
    }
  }

  /**
 
View Full Code Here

      Point3 p2 = o2.bound.center();

      switch (this.axis) {
      case X_AXIS: return Double.compare(p1.x(), p2.x());
      case Y_AXIS: return Double.compare(p1.y(), p2.y());
      case Z_AXIS: return Double.compare(p1.z(), p2.z());
      }

      throw new UnsupportedOperationException("invalid axis");
    }
View Full Code Here

    Point3    p = ray.pointAt(I.minimum());
    Cell    cell;
    Cell    nextCell = this.nearestCell(p);
    double    rx = p.x() - (bound.minimumX() + (double) nextCell.cx * dx);
    double    ry = p.y() - (bound.minimumY() + (double) nextCell.cy * dy);
    double    rz = p.z() - (bound.minimumZ() + (double) nextCell.cz * dz);

    do {

      cell = nextCell;

View Full Code Here

    Point3 org = ray.origin();
    Vector3 dir = ray.direction();

    double x0 = org.x() / radius;
    double y0 = org.y() / height - 1.0;
    double z0 = org.z() / radius;
    double x1 = dir.x() / radius;
    double y1 = dir.y() / height;
    double z1 = dir.z() / radius;

    Polynomial f = new Polynomial(
View Full Code Here

    case CONE_SURFACE_BODY:
      Point3 p = x.getPosition();
      double side = Math.hypot(radius, height);
      double c = radius / side;
      double s = height / side;
      double hyp = Math.hypot(p.x(), p.z());

      return new Vector3(
          s * p.x() / hyp,
          c,
          s * p.z() / hyp);
View Full Code Here

      double hyp = Math.hypot(p.x(), p.z());

      return new Vector3(
          s * p.x() / hyp,
          c,
          s * p.z() / hyp);

    case CONE_SURFACE_BASE:
      return Vector3.NEGATIVE_J;

    default:
View Full Code Here

  @Override
  protected Point2 getTextureCoordinates(GeometryIntersection x) {
    Point3 p = x.getPosition();
    switch (x.getTag()) {
    case CONE_SURFACE_BODY:
      double angle = Math.PI + Math.atan2(p.z(), p.x());
      return new Point2(angle / ((capped ? 4.0 : 2.0) * Math.PI),
          p.y() / height);

    case CONE_SURFACE_BASE:
      return new Point2(0.5 + (p.x() + radius) / (4.0 * radius),
 
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.