Package ca.eandb.jmist.math

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


      cell = nextCell;

      double  tx, ty, tz, t;

      tx = (d.x() > 0.0) ? (dx - rx) / d.x() : -rx / d.x();
      ty = (d.y() > 0.0) ? (dy - ry) / d.y() : -ry / d.y();
      tz = (d.z() > 0.0) ? (dz - rz) / d.z() : -rz / d.z();

      if (tx < ty && tx < tz) {
        t = tx;
        rx = (d.x() > 0.0) ? 0.0 : dx;
View Full Code Here


      cell = nextCell;

      double  tx, ty, tz, t;

      tx = (d.x() > 0.0) ? (dx - rx) / d.x() : -rx / d.x();
      ty = (d.y() > 0.0) ? (dy - ry) / d.y() : -ry / d.y();
      tz = (d.z() > 0.0) ? (dz - rz) / d.z() : -rz / d.z();

      if (tx < ty && tx < tz) {
        t = tx;
        rx = (d.x() > 0.0) ? 0.0 : dx;
View Full Code Here

      cell = nextCell;

      double  tx, ty, tz, t;

      tx = (d.x() > 0.0) ? (dx - rx) / d.x() : -rx / d.x();
      ty = (d.y() > 0.0) ? (dy - ry) / d.y() : -ry / d.y();
      tz = (d.z() > 0.0) ? (dz - rz) / d.z() : -rz / d.z();

      if (tx < ty && tx < tz) {
        t = tx;
        rx = (d.x() > 0.0) ? 0.0 : dx;
View Full Code Here

      tz = (d.z() > 0.0) ? (dz - rz) / d.z() : -rz / d.z();

      if (tx < ty && tx < tz) {
        t = tx;
        rx = (d.x() > 0.0) ? 0.0 : dx;
        ry += t * d.y();
        rz += t * d.z();
        nextCell = new Cell(cell.cx + (d.x() > 0.0 ? 1 : -1), cell.cy, cell.cz);
      } else if (ty < tz) {
        t = ty;
        rx += t * d.x();
 
View Full Code Here

        rz += t * d.z();
        nextCell = new Cell(cell.cx + (d.x() > 0.0 ? 1 : -1), cell.cy, cell.cz);
      } else if (ty < tz) {
        t = ty;
        rx += t * d.x();
        ry = (d.y() > 0.0) ? 0.0 : dy;
        rz += t * d.z();
        nextCell = new Cell(cell.cx, cell.cy + (d.y() > 0.0 ? 1 : -1), cell.cz);
      } else { // tz <= tx && tz <= ty
        t = tz;
        rx += t * d.x();
 
View Full Code Here

      } else if (ty < tz) {
        t = ty;
        rx += t * d.x();
        ry = (d.y() > 0.0) ? 0.0 : dy;
        rz += t * d.z();
        nextCell = new Cell(cell.cx, cell.cy + (d.y() > 0.0 ? 1 : -1), cell.cz);
      } else { // tz <= tx && tz <= ty
        t = tz;
        rx += t * d.x();
        ry += t * d.y();
        rz = (d.z() > 0.0) ? 0.0 : dz;
View Full Code Here

        rz += t * d.z();
        nextCell = new Cell(cell.cx, cell.cy + (d.y() > 0.0 ? 1 : -1), cell.cz);
      } else { // tz <= tx && tz <= ty
        t = tz;
        rx += t * d.x();
        ry += t * d.y();
        rz = (d.z() > 0.0) ? 0.0 : dz;
        nextCell = new Cell(cell.cx, cell.cy, cell.cz + (d.z() > 0.0 ? 1 : -1));
      }

      cellI = new Interval(cellI.maximum(), cellI.maximum() + t);
View Full Code Here

      Vector3 v = q.isPoint() ? q.toPoint3().unitVectorFromOrigin()
                          : q.toVector3().unit();
      Vector3 half = new Vector3(0.5 * v.x(), 0.5 * v.y(),
          0.5 * (v.z() - 1.0)).unit();
      double x = 0.5 * (half.x() + 1.0);
      double y = 0.5 * (1.0 - half.y());
      return new Point2(x, y);
    }

    /* (non-Javadoc)
     * @see ca.eandb.jmist.framework.path.PathNode#getCosine(ca.eandb.jmist.math.Vector3)
View Full Code Here

        return null;
      }

      double      ratio      = -focusDistance / dir.z();
      double      x        = ray.origin().x() + ratio * dir.x();
      double      y        = ray.origin().y() + ratio * dir.y();

      final double  u        = 0.5 + x / objPlaneWidth;
      if (!MathUtil.inRangeCC(u, 0.0, 1.0)) {
        return null;
      }
View Full Code Here

          width * (p.x() - 0.5),
          height * (0.5 - p.y()),
          -1.0);
      Ray3 ray = new Ray3(Point3.ORIGIN, v.unit());
      Color color = getWhite();
      double z = v.x() * v.x() + v.y() * v.y() + 1.0;
      double pdf = z * z / (width * height);
      return ScatteredRay.diffuse(ray, color, pdf);
    }

    /* (non-Javadoc)
 
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.