Package ca.eandb.jmist.math

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


    double r = reflectance.evaluate(lambda);
    double u = rnd.next() - r;
    if (u < 0.0) {
      Vector3 out = RandomUtil.diffuse(rnd).toCartesian(x.getBasis());
      return (v.dot(x.getNormal()) < 0.0) ? out : out.opposite();
    }
    double t = transmittance.evaluate(lambda);
    u -= t;
    if (u < 0.0) {
      Vector3 out = RandomUtil.diffuse(rnd).toCartesian(x.getBasis());
View Full Code Here


    }
    double t = transmittance.evaluate(lambda);
    u -= t;
    if (u < 0.0) {
      Vector3 out = RandomUtil.diffuse(rnd).toCartesian(x.getBasis());
      return (v.dot(x.getNormal()) < 0.0) ? out.opposite() : out;
    }

    return null;
  }
View Full Code Here

      boolean adjoint, double lambda, Random rnd) {

    Vector3 N = x.getNormal();

    if (v.dot(N) < 0.0) {
      N = N.opposite();
    }

    return RandomUtil.diffuse(rnd).toCartesian(Basis3.fromW(N));
  }
View Full Code Here

      WavelengthPacket lambda, double ru, double rv, double rj) {

    Vector3 N = x.getNormal();

    if (v.dot(N) < 0.0) {
      N = N.opposite();
    }

    return ScatteredRay.transmitDiffuse(new Ray3(x.getPosition(),
        RandomUtil.diffuse(ru, rv).toCartesian(Basis3.fromW(N))),
        lambda.getColorModel().getWhite(lambda), 1.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.