Package ca.eandb.jmist.math

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


     * @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;
      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;
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

    /* (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;
      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();
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());
      double  d2 = nx * nx + ny * ny;

      if (d2 > 1.0)
        return null;
View Full Code Here

    @Override
    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
View Full Code Here

     * @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;

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

      throw new IllegalArgumentException("invalid surface id");

    }

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

  }

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.