Package ca.eandb.jmist.math

Examples of ca.eandb.jmist.math.Basis3


  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.Modifier#modify(ca.eandb.jmist.framework.ShadingContext)
   */
  @Override
  public void modify(ShadingContext context) {
    Basis3 basis = context.getBasis();
    RGB c = painter.getColor(context, WAVELENGTH_PACKET).toRGB();
    Vector3 n = Vector3.unit(c.r() - 0.5, c.g() - 0.5, c.b() - 0.5);
    Vector3 u = basis.u();
    Vector3 v = basis.v();

    basis = Basis3.fromWUV(n, u, v);
    context.setShadingBasis(basis);
  }
View Full Code Here


  /* (non-Javadoc)
   * @see ca.eandb.jmist.framework.Modifier#modify(ca.eandb.jmist.framework.ShadingContext)
   */
  @Override
  public void modify(ShadingContext context) {
    Basis3 basis = context.getShadingBasis();
    RGB c = painter.getColor(context, WAVELENGTH_PACKET).toRGB();
    Vector3 n = basis.toStandard(c.r() - 0.5, 0.5 - c.g(), c.b() - 0.5).unit();
    Vector3 u = basis.u();
    Vector3 v = basis.v();

    basis = Basis3.fromWUV(n, u, v);
    context.setShadingBasis(basis);
  }
View Full Code Here

   * @see ca.eandb.jmist.framework.Modifier#modify(ca.eandb.jmist.framework.ShadingContext)
   */
  @Override
  public void modify(ShadingContext context) {

    Basis3 basis = context.getShadingBasis();

    Point2 p = context.getUV();
    Point2 pu = new Point2(p.x() + deltaU, p.y());
    Point2 pv = new Point2(p.x(), p.y() + deltaV);
    double h = scale * height.opacity(p);
    double hu = scale * height.opacity(pu);
    double hv = scale * height.opacity(pv);

    Vector3 n = basis.toStandard(h - hu, h - hv, 1.0).unit();
    Vector3 u = basis.u();
    Vector3 v = basis.v();

    basis = Basis3.fromWUV(n, u, v);
    context.setShadingBasis(basis);

  }
View Full Code Here

   * @param p The position.
   * @param N The normal.
   * @return A <code>SurfacePointGeometry</code>.
   */
  public static SurfacePointGeometry createSurfacePointGeometry(Point3 p, Vector3 N) {
    Basis3 basis = Basis3.fromW(N);
    return new SimpleSurfacePointGeometry(p, basis, basis, Point2.ORIGIN);
  }
View Full Code Here

   * @param N The normal.
   * @param shadingNormal The micro-surface normal.
   * @return A <code>SurfacePointGeometry</code>.
   */
  public static SurfacePointGeometry createSurfacePointGeometry(Point3 p, Vector3 N, Vector3 shadingNormal) {
    Basis3 basis = Basis3.fromW(N);
    Basis3 shadingBasis = Basis3.fromW(shadingNormal);
    return new SimpleSurfacePointGeometry(p, basis, shadingBasis, Point2.ORIGIN);
  }
View Full Code Here

   * @param N The normal.
   * @param uv The texture coordinates.
   * @return A <code>SurfacePointGeometry</code>.
   */
  public static SurfacePointGeometry createSurfacePointGeometry(Point3 p, Vector3 N, Point2 uv) {
    Basis3 basis = Basis3.fromW(N);
    return new SimpleSurfacePointGeometry(p, basis, basis, uv);
  }
View Full Code Here

   * @param shadingNormal The micro-surface normal.
   * @param uv The texture coordinates.
   * @return A <code>SurfacePointGeometry</code>.
   */
  public static SurfacePointGeometry createSurfacePointGeometry(Point3 p, Vector3 N, Vector3 shadingNormal, Point2 uv) {
    Basis3 basis = Basis3.fromW(N);
    Basis3 shadingBasis = Basis3.fromW(shadingNormal);
    return new SimpleSurfacePointGeometry(p, basis, shadingBasis, uv);
  }
View Full Code Here

      TransformableGeometry segment = new TransformableGeometry(
          new TaperedCylinderGeometry(h1, r1, length + h2, r2, false));

      Vector3 v = previous.center().vectorTo(sphere.center());
      Basis3 basis = Basis3.fromV(v);
      AffineMatrix3 T = AffineMatrix3.fromColumns(basis.u(), basis.v(), basis.w(), previous.center());

      segment.transform(T);
      geometry.addChild(segment);
    }
    geometry.addChild(new SphereGeometry(sphere));
View Full Code Here

      Point3 p = new Point3(halfTableDiag * cost1, halfTableDiag * sint1, 0.0);
      Point3 q = new Point3(radius * cost1, radius * sint1, -crownHeight);
      Point3 r;

      Basis3 basis = Basis3.fromUW(p.vectorTo(q), Vector3.K);
      Plane3 planeKite = Plane3.throughPoint(p, basis);

      b.slice(planeKite, true);

      q = new Point3(halfTableDiag * cost3, halfTableDiag * sint3, 0.0);
View Full Code Here

    Color s = specular.getColor(x, lambda);
    double davg = ColorUtil.getMeanChannelValue(d);
    double savg = ColorUtil.getMeanChannelValue(s);
    double total = davg + savg;

    Basis3 basis = x.getShadingBasis();
    Vector3 out;

    if (RandomUtil.bernoulli(davg / total, rj)) { // diffuse

      do {
View Full Code Here

TOP

Related Classes of ca.eandb.jmist.math.Basis3

Copyright © 2018 www.massapicom. 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.