Package ca.eandb.jmist.math

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


     */
    public ScatteredRay sample(double ru, double rv, double rj) {
      Point2 p = pointOnImagePlane;
      Vector3 v = new Vector3(
          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);
 
View Full Code Here


      double area = 0.0;
      for (int i = 0; i < indices.length - 1; i++) {
        Point2 a = vertices.get(indices[i]);
        Point2 b = vertices.get(indices[i + 1]);

        area += a.x() * b.y() - b.x() * a.y();
      }
      area /= 2.0;
      return area;
    }

View Full Code Here

    public ScatteredRay sample(double ru, double rv, double rj) {
      Point2 p = pointOnImagePlane;
      double theta = (p.x() - 0.5) * hfov;
      Vector3 v = new Vector3(
          Math.sin(theta),
          (0.5 - p.y()) * height,
          -Math.cos(theta));
      double r = v.length();
      Ray3 ray = new Ray3(Point3.ORIGIN, v.divide(r));
      Color color = getWhite();
      double pdf = (r * r * r * r) / (hfov * height);
 
View Full Code Here

     */
    @Override
    public ScatteredRay sample(double ru, double rv, double rj) {
      Point2  p = pointOnImagePlane;
      double  nx = 2.0 * (p.x() - 0.5);
      double  ny = 2.0 * (0.5 - p.y());
      double  d2 = nx * nx + ny * ny;

      if (d2 > 1.0)
        return null;

View Full Code Here

    public Point2 project(HPoint3 x) {
      Point2 p = inner.project(x);
      return p != null && bounds.contains(p)
        ? new Point2(
          (p.x() - bounds.minimumX()) / bounds.lengthX(),
          (p.y() - bounds.minimumY()) / bounds.lengthY())
        : null;
    }

    @Override
    public double getCosine(Vector3 v) {
View Full Code Here

     */
    public ScatteredRay sample(double ru, double rv, double rj) {
      Point2 p = pointOnImagePlane;

        double    nx = (p.x() - 0.5) * hfov;
        double    ny = (0.5 - p.y()) * vfov;

        double    sx = Math.sin(nx);
        double    sy = Math.sin(ny);
        double    cx = Math.cos(nx);
        double    cy = Math.cos(ny);
View Full Code Here

                c1.x(), c1.y());
            System.err.println();
            System.err.printf("% 5d: (%5.3f, %5.3f) - (%5.3f, %5.3f) - (%5.3f, %5.3f)", tri2,
                a2.x(), a2.y(),
                b2.x(), b2.y(),
                c2.x(), c2.y());
            System.err.println();
            count++;
          }
        }
      }
View Full Code Here

            tb = new Point2(1, 1);
            tc = new Point2(0, 1);
          }
        }

        return new Point2(ta.x() * A + tb.x() * B + tc.x() * C, ta.y() * A + tb.y() * B + tc.y() * C);
      }

      return Point2.ORIGIN;
    }

View Full Code Here

    }

    return new Point2(
      FACE_DOMAIN[x.getTag()].minimumX() + facePoint.x() * FACE_DOMAIN[x.getTag()].lengthX(),
      FACE_DOMAIN[x.getTag()].minimumY() + facePoint.y() * FACE_DOMAIN[x.getTag()].lengthY()
    );

  }

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