Package ca.eandb.jmist.math

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


  @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();
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();
View Full Code Here

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

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

  @Override
  public double getScatteringPDF(SurfacePoint x, Vector3 in, Vector3 out,
      boolean adjoint, WavelengthPacket lambda) {

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

    in = in.unit();
    out = out.unit();
View Full Code Here

  @Override
  public double getScatteringPDF(SurfacePoint x, Vector3 in, Vector3 out,
      boolean adjoint, WavelengthPacket lambda) {

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

    in = in.unit();
    out = out.unit();
View Full Code Here

    Vector3 n = x.getShadingNormal();

    double D = d / 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;
 
View Full Code Here

    Vector3 n = x.getShadingNormal();

    double D = d / 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;
View Full Code Here

  @Override
  public ScatteredRay scatter(SurfacePoint x, Vector3 v, boolean adjoint,
      WavelengthPacket lambda, double ru, double rv, double rj) {

    Vector3 n = x.getNormal();
    if (n.dot(v) > 0.0) {
      return null;
    }

    Color d = diffuse.getColor(x, lambda);
    Color s = specular.getColor(x, lambda);
View Full Code Here

    /* (non-Javadoc)
     * @see ca.eandb.jmist.framework.path.PathNode#getCosine(ca.eandb.jmist.math.Vector3)
     */
    public double getCosine(Vector3 v) {
      Vector3 n = context.getNormal();
      return n.dot(v);
    }

    /* (non-Javadoc)
     * @see ca.eandb.jmist.framework.path.PathNode#getPosition()
     */
 
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.