Package ca.eandb.jmist.math

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


  protected Vector3 getNormal(GeometryIntersection x) {

    Point3  p = x.getPosition();
    double  A = Math.pow(Math.pow(Math.abs(p.x()), 2.0 / e) + Math.pow(Math.abs(p.y()), 2.0 / e), e / n - 1.0);
    double  X = A * Math.pow(Math.abs(p.x()), 2.0 / e - 1.0);
    double  Y = A * Math.pow(Math.abs(p.y()), 2.0 / e - 1.0);
    double  Z = Math.pow(Math.abs(p.z()), 2.0 / n - 1.0);

    return new Vector3(
      Math.signum(p.x()) * X,
      Math.signum(p.y()) * Y,
 
View Full Code Here


    double  Y = A * Math.pow(Math.abs(p.y()), 2.0 / e - 1.0);
    double  Z = Math.pow(Math.abs(p.z()), 2.0 / n - 1.0);

    return new Vector3(
      Math.signum(p.x()) * X,
      Math.signum(p.y()) * Y,
      Math.signum(p.z()) * Z
    ).unit();

  }

View Full Code Here

    Point3 c = this.boundingSphere.center();

    return new Box3(
        c.x() - ri,
        c.y() - rj,
        c.z() - rk,
        c.x() + ri,
        c.y() + rj,
        c.z() + rk
        );
View Full Code Here

    return new Box3(
        c.x() - ri,
        c.y() - rj,
        c.z() - rk,
        c.x() + ri,
        c.y() + rj,
        c.z() + rk
        );

  }
View Full Code Here

        Point3 p1 = ray.pointAt(I.maximum());

        /* Get the range of y-values for the ray within the cell, and
         * get the portion of the height matrix within the cell.
         */
        Interval h = Interval.between(p0.y(), p1.y());
        Matrix slice = height.slice(cell.getX(), cell.getZ(), 2, 2);

        boolean hit = false;

        /* If the range of y-values intersect, then there may be an
View Full Code Here

      // Check for intersection with each of the six sides of the box.
      if (ray.direction().x() != 0.0) {
        t = (box.minimumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() > 0.0, BOX_SURFACE_MIN_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

      // Check for intersection with each of the six sides of the box.
      if (ray.direction().x() != 0.0) {
        t = (box.minimumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() > 0.0, BOX_SURFACE_MIN_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

        }

        t = (box.maximumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() < 0.0, BOX_SURFACE_MAX_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

        }

        t = (box.maximumX() - ray.origin().x()) / ray.direction().x();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumY() < p.y() && p.y() < box.maximumY() && box.minimumZ() < p.z() && p.z() < box.maximumZ()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().x() < 0.0, BOX_SURFACE_MAX_X)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
View Full Code Here

      if (ray.direction().z() != 0.0) {
        t = (box.minimumZ() - ray.origin().z()) / ray.direction().z();
        if (t > 0.0) {
          p = ray.pointAt(t);
          if (box.minimumX() < p.x() && p.x() < box.maximumX() && box.minimumY() < p.y() && p.y() < box.maximumY()) {
            Intersection x = super.newIntersection(ray, t, ray.direction().z() > 0.0, BOX_SURFACE_MIN_Z)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
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.