Package ca.eandb.jmist.framework

Examples of ca.eandb.jmist.framework.Intersection


    int id = (twoSided && RandomUtil.coin(rj))
        ? DISC_SURFACE_BOTTOM
        : DISC_SURFACE_TOP;

    Intersection x = newSurfacePoint(p, id);
    x.prepareShadingContext(context);
  }
View Full Code Here


      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;
          }
        }

        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;
          }
        }
      }

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

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

      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;
          }
        }

        t = (box.maximumZ() - 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_MAX_Z)
              .setLocation(p);
            recorder.record(x);
            if (++n == 2) return;
          }
        }
View Full Code Here

      p = new Point3(dir ? box.maximumX() : box.minimumX(),
          RandomUtil.uniform(box.spanY(), ru),
          RandomUtil.uniform(box.spanZ(), rv));
    }

    Intersection x = newSurfacePoint(p, id);
    x.prepareShadingContext(context);
  }
View Full Code Here

TOP

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

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.