Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Point3


      return false;
    }

    Interval  cellI = new Interval(I.minimum(), I.minimum());
    Vector3    d = ray.direction();
    Point3    p = ray.pointAt(I.minimum());
    Cell    cell;
    Cell    nextCell = this.nearestCell(p);
    double    rx = p.x() - (bound.minimumX() + (double) nextCell.cx * dx);
    double    ry = p.y() - (bound.minimumY() + (double) nextCell.cy * dy);
    double    rz = p.z() - (bound.minimumZ() + (double) nextCell.cz * dz);

    do {

      cell = nextCell;

View Full Code Here


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

      if (I.isEmpty()) {
        return null;
      }
View Full Code Here

    u = t.apply(basis.u());
    v = t.apply(basis.v());

    context.setBasis(Basis3.fromUV(u, v));

    Point3 p = t.apply(context.getPosition());
    context.setPosition(p);

  }
View Full Code Here

        int primitive = primIndex[index];

        generateImportanceSampledSurfacePoint(primitive, x, context, rng.next(), rng.next(), rng.next());
        context.getModifier().modify(context);

        Point3 p = context.getPosition();
        Material mat = context.getMaterial();
        Vector3 v = x.getPosition().unitVectorFrom(p);
        Vector3 n = context.getShadingNormal();
        double d2 = x.getPosition().squaredDistanceTo(p);
        double atten = Math.max(n.dot(v), 0.0) * totalWeight
 
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.photonmap.PhotonBuffer#getPosition(int)
   */
  public Point3 getPosition(int index) {
    int offset = index * ELEMENT_SIZE;
    return new Point3(buffer.getFloat(offset + OFFSET_X), buffer.getFloat(offset + OFFSET_Y), buffer.getFloat(offset + OFFSET_Z));
  }
View Full Code Here

    public Node(Point2 p, PathInfo pathInfo, double ru, double rv, double rj) {
      super(pathInfo, ru, rv, rj);
      this.pointOnImagePlane = p;

      Vector2 uv = RandomUtil.uniformOnDisc(apertureRadius, ru, rv).toCartesian();
      Point3 origin = new Point3(uv.x(), uv.y(), 0.0);
      Point3 focus = new Point3(
          (pointOnImagePlane.x() - 0.5) * objPlaneWidth,
          (0.5 - pointOnImagePlane.y()) * objPlaneHeight,
          -focusDistance);

      Vector3 direction = origin.unitVectorTo(focus);
View Full Code Here

    double      t = this.plane.intersect(ray);

    if (!recorder.interval().contains(t))
      return;

    Point3      p = ray.pointAt(t);
    Vector3      r = p.vectorFrom(this.origin);
    Point2      uv = new Point2(r.dot(basis.u()), r.dot(basis.v()));

    if (!this.inside(uv))
      return;
View Full Code Here

    List<Point3> vertexList = new ArrayList<Point3>();

    for (int i = 0; i < this.vertices.size(); i++) {
      Point2 p = this.vertices.get(i);
      Point3 vertex = this.pointAt(p);

      vertexList.add(vertex);
    }

    return vertexList;
View Full Code Here

    double t = this.plane.intersect(ray);

    if (recorder.interval().contains(t)) {

      Point3 p = ray.pointAt(t);
      Vector3 dp = p.vectorFrom(this.center);

      double u = 0.5 + 0.5 * dp.dot(basis.u()) / ru;
      double v = 0.5 + 0.5 * dp.dot(basis.v()) / rv;

      if (MathUtil.inRangeCC(u, 0.0, 1.0) && MathUtil.inRangeCC(v, 0.0, 1.0)) {
View Full Code Here

  /*
   *
   */
  @Override
  public void generateRandomSurfacePoint(ShadingContext context, double xu, double xv, double xj) {
    Point3 p = center
        .plus(basis.u().times(RandomUtil.uniform(-ru, ru, xu)))
        .plus(basis.v().times(RandomUtil.uniform(-rv, rv, xv)));

    int id = (twoSided && RandomUtil.coin(xj))
        ? RECTANGLE_SURFACE_BOTTOM
View Full Code Here

TOP

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

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.