Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Point2


            if (shutter != null) {
              double time    = RandomUtil.uniform(shutter, random);
              animator.setTime(time);
            }

            Point2 p      = RandomUtil.uniform(bounds, random);
            Color sample    = colorModel.sample(random);
            PathInfo path    = new PathInfo(scene, sample.getWavelengthPacket());
            PathNode eyeTail  = strategy.traceEyePath(lens, p,
                          path, random);
View Full Code Here


    private Color joinInnerToEye(PathNode lightNode, EyeNode eyeNode,
        double weight) {
      double w = strategy.getWeight(lightNode, eyeNode);
      if (w > 0.0) {//MathUtil.EPSILON) {
        Point2 p = eyeNode.project(lightNode.getPosition());
        if (p != null) {
          Color c = measure.evaluate(lightNode, eyeNode);
          c = ColorUtil.mul(c, weight * w);
          if (c != null) {
//            synchronized (contribList) {
View Full Code Here

  @Override
  protected Point2 getTextureCoordinates(GeometryIntersection x) {
    Vector3          n = x.getNormal();
    SphericalCoordinates  sc = SphericalCoordinates.fromCartesian(new Vector3(n.x(), -n.z(), n.y()));

    return new Point2(
        (Math.PI + sc.azimuthal()) / (2.0 * Math.PI),
        sc.polar() / Math.PI
    );
  }
View Full Code Here

  private void readTexCoord(PlyElement element) {
    double u = element.getProperty("u").getDoubleValue();
    double v = element.getProperty("v").getDoubleValue();

    geometry.addTexCoord(new Point2(u, v));
  }
View Full Code Here

    default:
      throw new IllegalArgumentException("Invalid surface ID.");

    }

    return new Point2(tx, ty);

  }
View Full Code Here

   * @see ca.eandb.jmist.framework.AbstractGeometry#getTextureCoordinates(ca.eandb.jmist.framework.AbstractGeometry.GeometryIntersection)
   */
  @Override
  protected Point2 getTextureCoordinates(GeometryIntersection x) {
    SphericalCoordinates sc = SphericalCoordinates.fromCartesian(x.getPosition().vectorFromOrigin());
    return new Point2((Math.PI + sc.azimuthal()) / (2.0 * Math.PI), sc.polar() / Math.PI);
  }
View Full Code Here

  protected Point2 getTextureCoordinates(GeometryIntersection x) {

    Basis3 basis = x.getBasis();
    Vector3 r = x.getPosition().vectorFrom(this.boundingSphere.center());

    return new Point2(
        0.5 * (1.0 + r.dot(basis.u()) / this.boundingSphere.radius()),
        0.5 * (1.0 + r.dot(basis.v()) / this.boundingSphere.radius())
    );

  }
View Full Code Here

   */
  @Override
  protected Point2 getTextureCoordinates(GeometryIntersection x) {
    Point3 p = x.getPosition();
    Box3 bounds = grid.getBoundingBox();
    return new Point2(
        (p.x() - bounds.minimumX()) / (bounds.maximumX() - bounds.minimumX()),
        (p.z() - bounds.minimumZ()) / (bounds.maximumZ() - bounds.minimumZ())
    );
  }
View Full Code Here

    }

    if (newEyeTail == null && m1 > 0) {
      PathInfo pi = x.getPathInfo();
      Lens lens = pi.getScene().getLens();
      Point2 p = RandomUtil.canonical2(rnd);
      newEyeTail = lens.sample(p, pi, rnd.next(), rnd.next(), rnd.next());
      m1--;
    }
    while (m1-- > 0) {
      newEyeTail = newEyeTail.expand(rnd.next(), rnd.next(), rnd.next());
View Full Code Here

   * @see ca.eandb.jmist.framework.AbstractGeometry#getTextureCoordinates(ca.eandb.jmist.framework.AbstractGeometry.GeometryIntersection)
   */
  @Override
  protected Point2 getTextureCoordinates(GeometryIntersection x) {

    Point2  facePoint;
    Point3  p = x.getPosition();

    switch (x.getTag())
    {
    case BOX_SURFACE_MAX_X:
      facePoint = new Point2(
          (box.maximumZ() - p.z()) / box.lengthX(),
          (box.maximumY() - p.y()) / box.lengthY()
      );
      break;

    case BOX_SURFACE_MIN_X:
      facePoint = new Point2(
          (p.z() - box.minimumZ()) / box.lengthZ(),
          (box.maximumY() - p.y()) / box.lengthY()
      );
      break;

    case BOX_SURFACE_MAX_Y:
      facePoint = new Point2(
          (p.x() - box.minimumX()) / box.lengthX(),
          (p.z() - box.minimumZ()) / box.lengthZ()
      );
      break;

    case BOX_SURFACE_MIN_Y:
      facePoint = new Point2(
          (p.x() - box.minimumX()) / box.lengthX(),
          (box.maximumZ() - p.z()) / box.lengthZ()
      );
      break;

    case BOX_SURFACE_MAX_Z:
      facePoint = new Point2(
          (p.x() - box.minimumX()) / box.lengthX(),
          (box.maximumY() - p.y()) / box.lengthY()
      );
      break;

    case BOX_SURFACE_MIN_Z:
      facePoint = new Point2(
          (p.x() - box.minimumX()) / box.lengthX(),
          (p.y() - box.minimumY()) / box.lengthY()
      );
      break;

    default:
      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

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.