Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Vector3.dot()


    public double getPDF(Vector3 v) {
      if (weight < 0.0) {
        return 0.0;
      }
      Vector3 n = context.getNormal();
      return (n.dot(v) > 0.0) ? 1.0 / Math.PI : 0.0;
    }

  }

}
View Full Code Here


      Vector3 v = t.apply(Vector3.J).unit();
      Vector3 w = t.apply(Vector3.K).unit();

      shapePreserving = (u.dot(v) < MathUtil.EPSILON)
          && (v.dot(w) < MathUtil.EPSILON)
          && (w.dot(u) < MathUtil.EPSILON);
    }
  }

  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.AffineTransformable3#transform(ca.eandb.jmist.math.AffineMatrix3)
View Full Code Here

        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
            / (4.0 * Math.PI * d2);
        Color ri = mat.emission(context, v, lambda).times(atten);
        LightSample sample = new PointLightSample(x, p, ri);

        target.addLightSample(sample);
View Full Code Here

    for (int i = 1; i < np.found; i++) {
      int index = np.index[i];
      // the following check can be omitted (for speed) if the scene does
      // not have any thin surfaces.
      Vector3 pdir = photons.getDir(index);
      if (pdir.dot(normal) < 0.0) {
        irrad += photons.getPower(index);
      }
    }

    irrad *= (1.0 / Math.PI) / np.squaredDistance[0]// estimate of density
View Full Code Here

    this.plane = Plane3.throughPoint(this.origin, this.basis.w());

    this.vertices.clear();
    for (int i = 0; i < vertices.length; i++) {
      Vector3 r = this.origin.vectorTo(vertices[i]);
      this.vertices.add(new Point2(r.dot(basis.u()), r.dot(basis.v())));
    }

    for (int i = 0; i < components.length; i++) {
      this.insert(new Component(components[i]), null);
    }
View Full Code Here

    this.plane = Plane3.throughPoint(this.origin, this.basis.w());

    this.vertices.clear();
    for (int i = 0; i < vertices.length; i++) {
      Vector3 r = this.origin.vectorTo(vertices[i]);
      this.vertices.add(new Point2(r.dot(basis.u()), r.dot(basis.v())));
    }

    for (int i = 0; i < components.length; i++) {
      this.insert(new Component(components[i]), null);
    }
View Full Code Here

    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;

    Point2      inversion = new Point2(
View Full Code Here

    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;

    Point2      inversion = new Point2(
View Full Code Here

              (uv.y() - this.bound.minimumY()) / this.bound.lengthY()
            );

    Vector3      N = this.plane.normal();

    double      ndotv    = N.dot(ray.direction());
    int        surfaceId  = (ndotv < 0.0) ? POLYGON_SURFACE_TOP : POLYGON_SURFACE_BOTTOM;

    Intersection  x = super.newIntersection(ray, t, ndotv < 0.0, surfaceId)
                .setLocation(p)
                .setUV(inversion)
View Full Code Here

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

    Vector3 n = x.getNormal();
    boolean fromFront = (n.dot(in) < 0.0);
    boolean toFront = (n.dot(out) > 0.0);

    Vector3 n1 = x.getShadingNormal();
    boolean fromFront1 = (n1.dot(in) < 0.0);

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.