Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Vector3


  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.path.PathNode#getCosine(ca.eandb.jmist.math.Vector3)
   */
  public double getCosine(Vector3 v) {
    Vector3 n = surf.getShadingNormal();
    return Math.abs(v.unit().dot(n));
  }
View Full Code Here


          throw new IllegalArgumentException(
              "grandChild and newParent.getParent() are different.");
        }
      }

      Vector3 v = PathUtil.getDirection(newParent, this);
      Point3 origin = newParent.isAtInfinity()
          ? surf.getPosition().minus(v)
          : newParent.getPosition().toPoint3();
      Ray3 ray = new Ray3(origin, v);
      ScatteredRay sr;
View Full Code Here

  public Color scatter(Vector3 v) {
    PathInfo path = getPathInfo();
    PathNode parent = getParent();
    Material material = surf.getMaterial();
    WavelengthPacket lambda = path.getWavelengthPacket();
    Vector3 in, out;
    if (isOnLightPath()) {
      in = PathUtil.getDirection(parent, this);
      out = v;
    } else { // isOnEyePath()
      in = v.opposite();
View Full Code Here

    PathInfo path = getPathInfo();
    PathNode parent = getParent();
    Material material = surf.getMaterial();
    WavelengthPacket lambda = path.getWavelengthPacket();
    boolean adjoint = isOnEyePath();
    Vector3 in = PathUtil.getDirection(parent, this);
    return material.getScatteringPDF(surf, in, out, adjoint, lambda);
  }
View Full Code Here

    PathInfo path = getPathInfo();
    PathNode parent = getParent();
    Material material = surf.getMaterial();
    WavelengthPacket lambda = path.getWavelengthPacket();
    boolean adjoint = isOnLightPath();
    Vector3 out = PathUtil.getDirection(this, parent);
    return material.getScatteringPDF(surf, in, out, adjoint, lambda);
  }
View Full Code Here

        untilCallback = progressInterval;

      }

      Vector3 v = specimen.scatter(SurfacePointGeometry.STANDARD, in, false, wavelength, rng);

      if (v != null) {
        collectorSphere.record(v, sensorArray);
      }
View Full Code Here

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.material.AbstractMaterial#bsdf(ca.eandb.jmist.framework.SurfacePoint, ca.eandb.jmist.math.Vector3, ca.eandb.jmist.math.Vector3, ca.eandb.jmist.framework.color.WavelengthPacket)
   */
  @Override
  public Color bsdf(SurfacePoint x, Vector3 in, Vector3 out, WavelengthPacket lambda) {
    Vector3    E = out;
    Vector3    L = in.opposite();
    Vector3    H = L.plus(E).unit();
    Vector3    N = x.getShadingNormal();
    double    HdotN = H.dot(N);
    double    EdotH = E.dot(H);
    double    EdotN = E.dot(N);
    double    LdotN = L.dot(N);
    double    tanAlpha = Math.tan(Math.acos(HdotN));
View Full Code Here

      double r2 = jointRadius2 * sinTheta;

      TransformableGeometry segment = new TransformableGeometry(
          new TaperedCylinderGeometry(h1, r1, length + h2, r2, false));

      Vector3 v = previous.center().vectorTo(sphere.center());
      Basis3 basis = Basis3.fromV(v);
      AffineMatrix3 T = AffineMatrix3.fromColumns(basis.u(), basis.v(), basis.w(), previous.center());

      segment.transform(T);
      geometry.addChild(segment);
View Full Code Here

   */
  @Override
  public Color bsdf(SurfacePoint x, Vector3 in, Vector3 out,
      WavelengthPacket lambda) {

    Vector3 N = x.getNormal();
    if (-N.dot(in) <= 0.0 || N.dot(out) <= 0.0) {
      return lambda.getColorModel().getBlack(lambda);
    }

    in = in.unit();
    out = out.unit();

    Color d = diffuse.getColor(x, lambda);
    Color s = specular.getColor(x, lambda);

    Vector3 n = x.getShadingNormal();

    Color D = d.divide(Math.PI);

    double ci = -n.dot(in);
    double co = n.dot(out);
    Vector3 h = out.minus(in).unit();

    double ch = n.dot(h);
    double ch2 = ch * ch;
    double sh2 = 1.0 - ch2;
    double th2 = sh2 / ch2;
View Full Code Here

    double starPointRadius = halfTableWidth * (1.0 - cut.relStarLength)
        + radius * cut.relStarLength;
    double lowerGirdleInner = radius * (1.0 - cut.relLowerHalfLength);

    MeshBuilder b = MeshBuilder.fromCylinder(radius, -culetBottom, 64);
    b.translate(new Vector3(0, 0, culetBottom));

    for (int i = 0; i < 8; i++) {

      double theta0 = 2.0 * Math.PI * ((double) i) / 8.0;
      double theta1 = 2.0 * Math.PI * (((double) i) + 0.5) / 8.0;
View Full Code Here

TOP

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

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.