Package ca.eandb.jmist.math

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


      }
      Intersection x = rec.nearestIntersection();
      MinimalShadingContext ctx = new MinimalShadingContext(Random.DEFAULT);
      x.prepareShadingContext(ctx);
      Point2 uv = ctx.getUV();
      if (trim.opacity(new Point2(uv.x(), 1.0 - uv.y())) > 0.5) {
        recorder.record(x);
        if (!recorder.needAllIntersections()) {
          break;
        }
      }
View Full Code Here


      }
      Intersection x = rec.nearestIntersection();
      MinimalShadingContext ctx = new MinimalShadingContext(Random.DEFAULT);
      x.prepareShadingContext(ctx);
      Point2 uv = ctx.getUV();
      if (trim.opacity(new Point2(uv.x(), 1.0 - uv.y())) > 0.5) {
        recorder.record(x);
        if (!recorder.needAllIntersections()) {
          break;
        }
      }
View Full Code Here

    @Override
    public ScatteredRay sample(double ru, double rv, double rj) {
      Point2 p = pointOnImagePlane;
      SphericalCoordinates v = new SphericalCoordinates(
          Math.acos(1.0 - 2.0 * p.y()),
          2.0 * Math.PI * p.x());
      Ray3 ray = new Ray3(Point3.ORIGIN, v.toCartesian(BASIS));
      Color color = getWhite();
      double pdf = 1.0 / (4.0 * Math.PI);

      return ScatteredRay.diffuse(ray, color, pdf);
View Full Code Here

     */
    public ScatteredRay sample(double ru, double rv, double rj) {
      Point2 p = pointOnImagePlane;
      Ray3 ray = new Ray3(
          new Point3(
            (p.x() - 0.5) * width,
            (0.5 - p.y()) * height,
            0.0),
          Vector3.NEGATIVE_K);
      Color color = getWhite();
      return ScatteredRay.specular(ray, color, 1.0);
View Full Code Here

     * @see ca.eandb.jmist.framework.path.PathNode#getPosition()
     */
    public HPoint3 getPosition() {
      Point2 p = pointOnImagePlane;
      return new Point3(
          (p.x() - 0.5) * width,
          (0.5 - p.y()) * height,
          0.0);
    }

    /* (non-Javadoc)
 
View Full Code Here

     * @see ca.eandb.jmist.framework.path.PathNode#sample(double, double, double)
     */
    @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());

      Ray3    init  = new Ray3(new Point3(nx, ny, 1.0), Vector3.K);
      Interval  I    = LENS_SPHERE.intersect(init);

View Full Code Here

    if (!circle.isEmpty()) {
      double r = circle.radius();
      Point2 c = circle.center();

      if (this.isEmpty()) {
        minimumX = c.x() - r;
        minimumY = c.y() - r;
        maximumX = c.x() + r;
        maximumY = c.y() + r;
      } else {
        minimumX = Math.min(c.x() - r, minimumX);
View Full Code Here

      Point2 c = circle.center();

      if (this.isEmpty()) {
        minimumX = c.x() - r;
        minimumY = c.y() - r;
        maximumX = c.x() + r;
        maximumY = c.y() + r;
      } else {
        minimumX = Math.min(c.x() - r, minimumX);
        minimumY = Math.min(c.y() - r, minimumY);
        maximumX = Math.max(c.x() + r, maximumX);
View Full Code Here

        minimumX = c.x() - r;
        minimumY = c.y() - r;
        maximumX = c.x() + r;
        maximumY = c.y() + r;
      } else {
        minimumX = Math.min(c.x() - r, minimumX);
        minimumY = Math.min(c.y() - r, minimumY);
        maximumX = Math.max(c.x() + r, maximumX);
        maximumY = Math.max(c.y() + r, maximumY);
      }
    }
View Full Code Here

        maximumX = c.x() + r;
        maximumY = c.y() + r;
      } else {
        minimumX = Math.min(c.x() - r, minimumX);
        minimumY = Math.min(c.y() - r, minimumY);
        maximumX = Math.max(c.x() + r, maximumX);
        maximumY = Math.max(c.y() + r, maximumY);
      }
    }
  }
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.