Examples of XYZPoint


Examples of org.jwildfire.create.tina.base.XYZPoint

  public void init(FlameTransformationContext pContext, Layer pLayer, XForm pXForm, double pAmount) {
    if (flame != null) {
      Layer layer = flame.getFirstLayer();
      layer.refreshModWeightTables(pContext);
      xf = layer.getXForms().get(0);
      p = new XYZPoint();
      p.x = 2.0 * pContext.random() - 1.0;
      p.y = 2.0 * pContext.random() - 1.0;
      p.z = 0.0;
      p.color = pContext.random();
    }
View Full Code Here

Examples of org.jwildfire.create.tina.base.XYZPoint

    The transform creates a sphere by converting the x and y values to a radius,
    which becomes "t" for a parametric equation.
    */

    // Initial coordinates
    XYZPoint ini = new XYZPoint();
    ini.x = pAffineTP.x;
    ini.y = pAffineTP.y;
    ini.z = pAffineTP.z;
    ini.x -= shift_x;
    ini.y -= shift_y;
    //ini.z -= shift_z;
    ini.invalidate();

    /* Convert x and y of point to parametric space,
     noting they are the radius outward in real space. */
    double t = ini.getPrecalcSqrt() / stretch - M_PI / 2;

    // circular curve, expanded by pAmount
    double r = cos(t) * pAmount;// * ini.getPrecalcSqrt();
    double z = sin(t) * pAmount;// * ini.getPrecalcSqrt();

    // Convert parametric space (2D) back to real space (3D)
    /* A new coordinate equals the new factor times a unit vector in the
     direction of the coordinate of interest. */
    pVarTP.x += r * (ini.x / ini.getPrecalcSqrt());
    pVarTP.y += r * (ini.y / ini.getPrecalcSqrt());
    pVarTP.z += z;

    if (pContext.isPreserveZCoordinate()) {
      // (this should cause positive z values to curl inside the sphere)

      /* Treating z as a vector that is split into two components, one being
       an x-component of parametric space which becomes a new radius for
       real space, taking into account conversion through unit vectors */
      pVarTP.x += r * ini.z * (ini.x / ini.getPrecalcSqrt());
      pVarTP.y += r * ini.z * (ini.y / ini.getPrecalcSqrt());

      /* The z-component is a normalized value from the parametric space y
       (which is real space z), taking into account the amount that went into
       the x component. */
      pVarTP.z += ini.z * z / (r * r + z * z);
 
View Full Code Here

Examples of org.jwildfire.create.tina.base.XYZPoint

        double ys = (yMax - yMin) / (double) (ySteps - 1.0);
        int xx[][] = new int[ySteps][xSteps];
        int yy[][] = new int[ySteps][xSteps];
        {
          double y = yMin;
          XYZPoint affineT = new XYZPoint(); // affine part of the transformation
          XYZPoint varT = new XYZPoint(); // complete transformation
          XYZPoint p = new XYZPoint();
          for (int i = 0; i < ySteps; i++) {
            double x = xMin;
            for (int j = 0; j < xSteps; j++) {
              p.x = x;
              p.y = y;
View Full Code Here

Examples of org.jwildfire.create.tina.base.XYZPoint

     NOTE: xp is made negative instead of cot(t) so as to perform the desired
     mirror in parametric space.
    */

    // Initial coordinates
    XYZPoint ini = new XYZPoint();
    ini.x = pAffineTP.x;
    ini.y = pAffineTP.y;
    ini.z = pAffineTP.z;
    ini.x -= shift_x;
    ini.y -= shift_y;
    //ini.z -= shift_z;
    ini.invalidate();

    // Final coordinates in parametric space
    double r;
    double z;

    /* Convert x and y of point to parametric space,
     noting they are the radius outward in real space. */
    double t = ini.getPrecalcSqrt() / stretch - M_PI / 2;

    /* NOTE: "t" and "meetingPt" are in radians */

    if (t > meetingPt) {
      // exponential curve
      r = cos(t);
      if (tan(meetingPt) != 0.0) {
        z = exp(cos(meetingPt) - r) / tan(meetingPt)
            + sin(meetingPt)
            - 1 / tan(meetingPt);

        if (z > top_crop && top_crop > 0) { /* FIX ADDED. top_crop could start at -1 for cropping below middle. */
          z = top_crop;
          r = 0;
        }
      }
      else {
        z = top_crop;
      }
    }
    else {
      // circular curve
      r = cos(t);
      z = sin(t);
    }
    // Expand radius of onion
    r *= circle_a * pAmount;
    z *= circle_b * pAmount;

    // Convert parametric space (2D) back to real space (3D)
    /* A new coordinate equals the new factor times a unit vector in the
     direction of the coordinate of interest. */
    pVarTP.x += r * (ini.x / ini.getPrecalcSqrt());
    pVarTP.y += r * (ini.y / ini.getPrecalcSqrt());
    pVarTP.z += z;

    if (pContext.isPreserveZCoordinate()) {
      // (this should cause positive z values to curl inside the onion)

      /* Treating z as a vector that is split into two components, one being
       an x-component of parametric space which becomes a new radius for
       real space, taking into account conversion through unit vectors */
      pVarTP.x += r * ini.z * (ini.x / ini.getPrecalcSqrt());
      pVarTP.y += r * ini.z * (ini.y / ini.getPrecalcSqrt());

      /* The z-component is a normalized value from the parametric space y
       (which is real space z), taking into account the amount that went into
       the x component. */
      pVarTP.z += ini.z * z / (r * r + z * z);
 
View Full Code Here

Examples of org.jwildfire.create.tina.base.XYZPoint

    }
  }

  private XYZPoint[] copyXYZPointArray(XYZPoint points[]) {
    if (points != null) {
      XYZPoint res[] = new XYZPoint[points.length];
      for (int i = 0; i < points.length; i++) {
        res[i] = points[i] != null ? points[i].makeCopy() : null;
      }
      return res;
    }
View Full Code Here

Examples of org.jwildfire.create.tina.base.XYZPoint

  public void init() {
  }

  public void preFuseIter() {
    affineT = new XYZPoint(); // affine part of the transformation
    varT = new XYZPoint(); // complete transformation
    p = new XYZPoint();
    q = new XYZPoint();
    p.x = 2.0 * randGen.random() - 1.0;
    p.y = 2.0 * randGen.random() - 1.0;
    p.z = 0.0;
    p.color = randGen.random();
    p.modGamma = 0.0;
View Full Code Here

Examples of org.jwildfire.create.tina.base.XYZPoint

    else {
      applyEmptyFinalTransform();
    }

    if (pThicknessMod > EPSILON && pTicknessSamples > 0) {
      XYZPoint w = new XYZPoint();
      w.assign(q);
      try {
        for (int i = 0; i < pTicknessSamples; i++) {
          addNoise(w, q, pThicknessMod);
          List<AbstractRasterPoint[][]> sliceRasters = collectSliceRasters(q, pSlices);
          for (AbstractRasterPoint[][] sliceRaster : sliceRasters) {
View Full Code Here

Examples of org.jwildfire.create.tina.base.XYZPoint

      parent = pParent;
      distance = pDistance;
      centreX = pCentreX;
      centreY = pCentreY;
      rotation = pRotation;
      a = new XYZPoint();
      b = new XYZPoint();

      double a = rotation * M_2PI / 180.0 / 2.0;
      doRotate = fabs(a) > EPSILON;

      sina = sin(a);
View Full Code Here

Examples of org.jwildfire.create.tina.base.XYZPoint

    public PointSymmetryProjector(PointProjector pParent, int pOrder, double pCentreX, double pCentreY) {
      parent = pParent;
      order = pOrder >= 1 ? pOrder : 1;
      centreX = pCentreX;
      centreY = pCentreY;
      ps = new XYZPoint();
      sina = new double[order];
      cosa = new double[order];
      double da = M_2PI / (double) order;
      double angle = 0.0;
      for (int i = 0; i < order; i++) {
View Full Code Here

Examples of org.jwildfire.create.tina.base.XYZPoint

    sinEye = sin(eyeAngle);
    cosEye = cos(eyeAngle);
    // always force 3d projection
    doProject3D = true;

    this.eyeOff = new XYZPoint();
    this.eyeOff.x = eyeDist;
    super.applyCameraMatrix(this.eyeOff);
  }
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.