Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Point2


  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.Mask2#opacity(ca.eandb.jmist.math.Point2)
   */
  @Override
  public double opacity(Point2 p) {
    p = new Point2(p.x() - Math.floor(p.x()), p.y() - Math.floor(p.y()));
    return inner.opacity(p);
  }
View Full Code Here


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

        break;
      }
      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 void modify(ShadingContext context) {

    Basis3 basis = context.getShadingBasis();

    Point2 p = context.getUV();
    Point2 pu = new Point2(p.x() + deltaU, p.y());
    Point2 pv = new Point2(p.x(), p.y() + deltaV);
    double h = scale * height.opacity(p);
    double hu = scale * height.opacity(pu);
    double hv = scale * height.opacity(pv);

    Vector3 n = basis.toStandard(h - hu, h - hv, 1.0).unit();
View Full Code Here

      double x = sc.azimuthal() / (2.0 * Math.PI);
      double y = 0.5 * (1.0 - Math.cos(sc.polar()));
      if (x < 0.0) {
        x += 1.0;
      }
      return new Point2(x, y);
    }
View Full Code Here

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

    /* (non-Javadoc)
     * @see ca.eandb.jmist.framework.path.EyeNode#sample(ca.eandb.jmist.math.Point2, ca.eandb.jmist.framework.Random)
     */
    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

    public Point2 project(HPoint3 x) {
      if (!x.isPoint()) {
        return null;
      }
      Point3 p = x.toPoint3();
      return new Point2(0.5 + p.x() / width, 0.5 - p.y() / height);
    }
View Full Code Here

    /* (non-Javadoc)
     * @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);
    }
View Full Code Here

                          : 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);
    }
View Full Code Here

TOP

Related Classes of ca.eandb.jmist.math.Point2

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.