Package ca.eandb.jmist.math

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


      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;
        ry += t * d.y();
 
View Full Code Here


      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;
        ry += t * d.y();
 
View Full Code Here

      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;
        ry += t * d.y();
 
View Full Code Here

      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();
        ry = (d.y() > 0.0) ? 0.0 : dy;
View Full Code Here

        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();
        ry += t * d.y();
 
View Full Code Here

        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

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

      if (cellI.maximum() > I.maximum()) {
View Full Code Here

     */
    @Override
    public Point2 project(HPoint3 p) {
      Ray3 pray = new Ray3(ray.origin(), p);
      Vector3 dir = pray.direction();
      if (-dir.z() < MathUtil.EPSILON) {
        return null;
      }

      double      ratio      = -focusDistance / dir.z();
      double      x        = ray.origin().x() + ratio * dir.x();
 
View Full Code Here

      Vector3 dir = pray.direction();
      if (-dir.z() < MathUtil.EPSILON) {
        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)) {
View Full Code Here

    @Override
    public ScatteredRay sample(double ru, double rv, double rj) {
      Vector3 v = ray.direction();
      Color color = getWhite();
      double pdf = (focusDistance * focusDistance)
          / (v.z() * v.z() * v.z() * v.z() * objPlaneWidth * objPlaneHeight);
      return ScatteredRay.diffuse(ray, color, pdf);
    }

    /* (non-Javadoc)
     * @see ca.eandb.jmist.framework.path.PathNode#scatter(ca.eandb.jmist.math.Vector3)
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.