Package ca.eandb.jmist.framework.color

Examples of ca.eandb.jmist.framework.color.Color.times()


    for (Material e : inner) {
      sr = e.scatter(x, v, adjoint, lambda, rnd.next(), rnd.next(), rnd.next());
      if (sr == null) break;
      v = sr.getRay().direction();
      col = col.times(sr.getColor());
    }

    if (sr == null) {
      return null;
    } else if (sr.getRay().direction().dot(x.getNormal()) < 0.0) {
View Full Code Here


//      }
//    }
//
//    return null;

    col = col.times(-thickness / Math.abs(x.getNormal().dot(v))).exp();
    return ScatteredRay.transmitSpecular(new Ray3(x.getPosition(), v), col, 1.0);

  }

View Full Code Here

      v = sr.getRay().direction();

      dir = (v.dot(N) > 0.0) ? -1 : 1;
      depth += dir;

      col = col.times(sr.getColor());

    } while (depth >= 0 && depth < layers.size());

    return depth < 0
      ? ScatteredRay.diffuse(sr.getRay(), col, 1.0)
View Full Code Here

//      }
//    }
//
//    return null;

    col = col.times(-thickness / Math.cos(Math.abs(x.getNormal().dot(v)))).exp();
    return ScatteredRay.transmitSpecular(new Ray3(x.getPosition(), v), col, 1.0);

  }

}
View Full Code Here

        } else if (MathUtil.equal(alpha, 0.0)) {
          return background.evaluate(p, lambda);
        } else {
          Color bg = background.evaluate(p, lambda);
          Color fg = cm.fromRGB(pixel[0]/255.0, pixel[1]/255.0, pixel[2]/255.0).sample(lambda);
          return fg.times(alpha).plus(bg.times(1.0 - alpha));
        }
      }
      default:
        throw new RuntimeException("Raster has unrecognized number of bands.");
      }
View Full Code Here

//        }
//      }
//
//      return null;

      col = col.times(-thickness.get() / Math.cos(Math.abs(x.getNormal().dot(v)))).exp();
      return ScatteredRay.transmitSpecular(new Ray3(x.getPosition(), v), col, 1.0);

    }

  }
View Full Code Here

  protected Color shadeAt(Point2 p) {
    Color        sample = model.sample(Random.DEFAULT);
    WavelengthPacket  lambda = sample.getWavelengthPacket();

    Color        shade = shader.shadeAt(p, lambda);
    return shade.times(sample);
  }

  /** The <code>ImageShader</code> to use for shading points. */
  private final ImageShader shader;

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.