Examples of opposite()


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

    double ndoti = -n.dot(in);
    double ndoto = n.dot(out);

    /* Eq. (13) */
    Vector3 hr = out.minus(in).times(Math.signum(ndoti)).unit();
    hr = hr.dot(n) > 0.0 ? hr : hr.opposite();

    double g = microfacets.getShadowingAndMasking(in, out, hr, n);
    double d = microfacets.getDistributionPDF(hr, n);
    double f = Optics.reflectance(in, n1, n2, hr);

View Full Code Here

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

      no = n1;
    }

    /* Eq. (16) */
    Vector3 ht = in.times(ni).minus(out.times(no)).unit();
    ht = ht.dot(n) > 0.0 ? ht : ht.opposite();

    double hdoti = -ht.dot(in);
    double hdoto = ht.dot(out);
    double ndoto = n.dot(out);

View Full Code Here

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

    double ndoto = n.dot(out);
    boolean reflected = (ndoti / ndoto) > 0.0;

    if (reflected) {
      Vector3 hr = out.minus(in).times(Math.signum(ndoti)).unit();
      hr = hr.dot(n) > 0.0 ? hr : hr.opposite();

      double partial = 1.0 / (4.0 * Math.abs(hr.dot(out)));
      double d = microfacets.getDistributionPDF(hr, n);
      double pm = d * Math.abs(hr.dot(n));
      double po = pm * partial;
 
View Full Code Here

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

        no = n1;
      }

      //Vector3 ht = out.times(no).minus(in.times(ni)).unit();
      Vector3 ht = in.times(ni).minus(out.times(no)).unit();
      ht = ht.dot(n) > 0.0 ? ht : ht.opposite();

      double hdoti = -ht.dot(in);
      double hdoto = ht.dot(out);

      double k = Math.abs(hdoti * hdoto / (ndoti * ndoto));
 
View Full Code Here

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

    double mdotn = Math.abs(m.dot(n));

    double ni = -v.dot(n) >= 0.0 ? n1 : n2;
    double nt = -v.dot(n) >= 0.0 ? n2 : n1;

    double r = Optics.reflectance(v, n1, n2, m.dot(n) > 0.0 ? m : m.opposite());
    boolean reflected = RandomUtil.bernoulli(r, rj);
    Vector3 out = reflected ? Optics.reflect(v, m) : Optics.refract(v, n1, n2, m);

    double g = microfacets.getShadowingAndMasking(v, out, m, n);
    double weight = (mdoti / (ndoti * mdotn)) * g;
 
View Full Code Here

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

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

    }
    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

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

      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

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

      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

Examples of com.tinkerpop.blueprints.Direction.opposite()

          } else if (curr.getSchemaClass().isSubClassOf(OrientEdgeType.CLASS_NAME)) {
            final Direction direction = getConnectionDirection(iFieldName, useVertexFieldsForEdgeLabels);

            // EDGE, REMOVE THE EDGE
            if (iVertexToRemove.equals(OrientEdge.getConnection(curr, direction.opposite()))) {
              it.remove();
              if (iAlsoInverse)
                removeInverseEdge(iVertex, iFieldName, iVertexToRemove, curr, useVertexFieldsForEdgeLabels);
              found = true;
              break;
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.