Package org.jwildfire.create.tina.variation

Examples of org.jwildfire.create.tina.variation.VariationFunc


      xForm.setWeight(1.0 + Math.random() * 100.0);
      if (Math.random() < 0.75) {
        xForm.addVariation(0.05 + Math.random() * 0.5, VariationFuncList.getVariationFuncInstance("bubble", true));
      }
      else {
        VariationFunc varFunc = VariationFuncList.getVariationFuncInstance("bubble2", true);
        varFunc.setParameter("z", -0.5 - Math.random() * 2.0);
        xForm.addVariation(0.25 + Math.random() * 0.5, varFunc);
      }
      xForm.addVariation(0.5 + 1.5 * Math.random(), VariationFuncList.getVariationFuncInstance("pre_blur", true));
      final String[] workingFncList = { "fan2", "blade", "blade3D", "blob", "blob3D", "bwraps7", "cell", "cannabiscurve_wf",
          "cloverleaf_wf", "cos", "cot", "coth", "cross", "csch", "diamond", "disc", "edisc", "epispiral_wf", "fan", "fisheye",
          "eyefish", "flux", "heart", "julia", "julian", "juliascope", "log", "parabola", "power", "epispiral",
          "pre_subflame_wf", "rectangles", "rose_wf", "sech", "separation", "split", "truchet", "wedge", "zcone" };
      final String[] fncList = Math.random() < 0.5 ? workingFncList : ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL;

      VariationFunc varFunc;
      if (Math.random() < 0.5) {
        varFunc = VariationFuncList.getVariationFuncInstance(VariationFuncList.getRandomVariationname());
      }
      else {
        varFunc = VariationFuncList.getVariationFuncInstance(fncList[(int) (fncList.length * Math.random())], true);
      }

      xForm.addVariation(-0.02 + 0.04 * Math.random(), varFunc);

      double shape = Math.random();
      if (shape < 0.125) {
        xForm.addVariation(0.001 + Math.random() * 0.01, VariationFuncList.getVariationFuncInstance("hexes", true));
      }
      else if (shape < 0.25) {
        xForm.addVariation(0.001 + Math.random() * 0.01, VariationFuncList.getVariationFuncInstance("oscilloscope", true));
      }
      else if (shape < 0.5) {
        xForm.addVariation(0.001 + Math.random() * 0.01, VariationFuncList.getVariationFuncInstance(VariationFuncList.getRandomVariationname(), true));
      }

      if (Math.random() > 0.33) {
        XFormTransformService.globalTranslate(xForm, -1.0 + 2.0 * Math.random(), -1.0 + 2.0 * Math.random(), true);
      }
      if (Math.random() > 0.33) {
        XFormTransformService.rotate(xForm, -32.0 + Math.random() * 72.0, false);
      }
      if (Math.random() > 0.33) {
        XFormTransformService.scale(xForm, 0.8 + Math.random() * 0.4, true, false);
      }
      xForm.setColor(0.0);
      xForm.setColorSymmetry(0.0);
    }
    // 2nd xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(1.0 + Math.random() * 50.0);
      int fncCount = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL.length;
      String fncName = Math.random() > 0.5 ? ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL[(int) (fncCount * Math.random())] : "eyefish";
      xForm.addVariation(-1.5 + 2 * Math.random() * 3.0, VariationFuncList.getVariationFuncInstance(fncName, true));
      xForm.addVariation(1.0 - 3.5 * Math.random(), VariationFuncList.getVariationFuncInstance("hemisphere", true));
      xForm.setColor(0.0);
      xForm.setColorSymmetry(0.0);
      if (Math.random() > 0.33) {
        XFormTransformService.globalTranslate(xForm, -3.0 + 62.0 * Math.random(), -3.0 + 6.0 * Math.random(), false);
      }
      if (Math.random() > 0.33) {
        XFormTransformService.rotate(xForm, -32.0 + Math.random() * 72.0, false);
      }
      if (Math.random() > 0.33) {
        XFormTransformService.scale(xForm, 0.8 + Math.random() * 0.4, true, false);
      }
    }
    // 3rd xForm   
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(1.0 + Math.random() * 100);
      VariationFunc varFunc = VariationFuncList.getVariationFuncInstance(Math.random() > 0.5 ? "julia3Dz" : "julia3D", true);
      int idx = Math.random() > 0.5 ? 2 : (int) (-20 + Math.random() * 40);
      if (idx == 0 || idx == 1) {
        idx = 2;
      }
      varFunc.setParameter("power", (double) idx);
      xForm.addVariation(1.0, varFunc);
      xForm.setColor(0.0);
      xForm.setColorSymmetry(0.0);
      XFormTransformService.globalTranslate(xForm, -1.0 + 2.0 * Math.random(), -3.0 + 6.0 * Math.random(), false);
      XFormTransformService.globalTranslate(xForm, -0.1 + 0.2 * Math.random(), -0.1 + 0.2 * Math.random(), true);
View Full Code Here


    Layer layer = flame.getFirstLayer();

    XForm xForm = new XForm();
    layer.getFinalXForms().add(xForm);
    xForm.addVariation(0.25 + Math.random() * 0.25, VariationFuncList.getVariationFuncInstance("linear3D", true));
    VariationFunc post_dcztransl = VariationFuncList.getVariationFuncInstance(PostDCZTranslFunc.VARNAME, true);
    xForm.addVariation(0.75 + Math.random() * 0.25, post_dcztransl);
    double factor = 0.5 + Math.random() * 2.0;
    if (Math.random() < 0.42) {
      factor = 0.0 - factor;
    }
    post_dcztransl.setParameter("factor", factor);

    flame = postProcessFlame(flame);

    return flame;
  }
View Full Code Here

    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(1.0 + Math.random() * 100.0);

      VariationFunc varFunc = VariationFuncList.getVariationFuncInstance(Math.random() < 0.8 ? "juliascope" : "julian", true);
      varFunc.setParameter("power", Math.random() < 0.8 ? 2 : 2 + Math.random() * 10.0);
      varFunc.setParameter("dist", Math.random() < 0.8 ? 1.0 : -2.0 + 4.0 * Math.random());
      xForm.addVariation(0.5 + Math.random(), varFunc);
      xForm.setColorSymmetry(0.5);

      XFormTransformService.rotate(xForm, Math.random() * 360.0, false);
      XFormTransformService.localTranslate(xForm, 1.75 - 3.50 * Math.random(), 0.75 - 5.50 * Math.random(), false);
      XFormTransformService.scale(xForm, 1.1 + Math.random() * 2.0, true, true, false);
    }

    layer.getXForms().get(0).getModifiedWeights()[0] = 0.0;
    layer.getXForms().get(0).getModifiedWeights()[1] = 1.0;

    if (Math.random() > 0.667) {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(1.0 + Math.random() * 100.0);
      VariationFunc varFunc = VariationFuncList.getVariationFuncInstance(VariationFuncList.getRandomVariationname(), true);
      xForm.addVariation(0.25 + 1.25 * Math.random(), varFunc);

      XFormTransformService.rotate(xForm, -12.0 + Math.random() * 24.0, true);
      XFormTransformService.localTranslate(xForm, -0.125 + Math.random() * 0.25, -0.125 + Math.random() * 0.25, true);
      XFormTransformService.scale(xForm, 0.9 + Math.random() * 0.2, true, true, true);
View Full Code Here

      XFormTransformService.localTranslate(xForm, 0.3 - 0.6 * Math.random(), 0.3 - 0.6 * Math.random(), false);
      XFormTransformService.rotate(xForm, 90.0 + Math.random() * 180.0, false);
      XFormTransformService.scale(xForm, 1.25 + Math.random() * 1.25, true, true, false);

      {
        VariationFunc varFunc;
        xForm.addVariation(1, VariationFuncList.getVariationFuncInstance("linear3D", true));
        xForm.addVariation(0.01 - Math.random() * 0.02, VariationFuncList.getVariationFuncInstance("epispiral_wf", true));
        xForm.addVariation(0.1 + Math.random() * 0.1, VariationFuncList.getVariationFuncInstance("ztranslate", true));
        xForm.addVariation(0.00001 - Math.random() * 0.00002, VariationFuncList.getVariationFuncInstance("zcone", true));
        {
          String fncLst[] = { "bubble", "log" };
          xForm.addVariation(0.001 + Math.random() * 0.099, VariationFuncList.getVariationFuncInstance(fncLst[(int) (fncLst.length * Math.random())], true));
        }
        {
          String fncLst[] = { "arch", "bipolar", "hyperbolic", "butterfly", "cannabiscurve_wf", "cell", "checks", "circlize", "conic",
              "coth", "cpow", "ex", "falloff2", "fan", "flux", "foci", "heart", "kaleidoscope", "log", "mobius", "ngon", "pdj",
              "oscilloscope", "spherical", "spiral" };
          xForm.addVariation(0.001 + Math.random() * 0.099, VariationFuncList.getVariationFuncInstance(fncLst[(int) (fncLst.length * Math.random())], true));
        }
        {
          String fncLst[] = { "waves2", "waves2_wf", "waves3_wf", "waves4_wf" };

          varFunc = VariationFuncList.getVariationFuncInstance(fncLst[(int) (fncLst.length * Math.random())], true);
          varFunc.setParameter("scalex", 0.5 + Math.random());
          varFunc.setParameter("scaley", 0.5 + Math.random());
          varFunc.setParameter("freqx", 1.0 + Math.random() * 2.0);
          varFunc.setParameter("freqy", 1.0 + Math.random() * 2.0);
          xForm.addVariation(0.05 - Math.random() * 0.1, varFunc);
        }
        {
          String fncLst[] = { "cross", "checks", "conic", "kaleidoscope", "lazysusan", "log" };
          xForm.addVariation(0.001 + Math.random() * 0.015, VariationFuncList.getVariationFuncInstance(fncLst[(int) (fncLst.length * Math.random())], true));
        }
      }
      xForm.setColor(0.33);
      xForm.setColorSymmetry(0);
    }
    // blur xForms
    {
      int blurCount = (int) (Math.random() * 5.0);
      double weight = 0.25 + Math.random() * 0.5;
      for (int i = 0; i < blurCount; i++) {
        XForm xForm = new XForm();
        layer.getXForms().add(xForm);
        xForm.setWeight(weight);
        weight *= 0.75;
        xForm.addVariation(0.25 + Math.random() * 0.5, VariationFuncList.getVariationFuncInstance("gaussian_blur", true));
        xForm.setColor(0);
        xForm.setColorSymmetry(0);
        XFormTransformService.localTranslate(xForm, 0.3 - 0.6 * Math.random(), 0.3 - 0.6 * Math.random(), true);

      }
    }
    // satellite xForm
    {
      String fncLst[] = { "blade", "blur", "blur3D", "bubble_wf", "cannabiscurve_wf", "circlecrop", "cloverleaf_wf", "conic", "crop", "cross",
          "flower", "flux", "hemisphere", "hyperbolic", "julia3D", "julia3Dz", "lazysusan", "lissajous", "log", "mandelbrot", "mobius", "npolar",
          "pdj", "perspective", "pie", "pie3D", "polar", "polar2", "power", "pre_subflame_wf", "radial_blur", "scry", "separation", "spiral",
          "spirograph", "split", "tangent", "tangent3D", "twintrian", "unpolar", "wedge_sph", "zblur" };
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.1 + Math.random() * 1.4);
      XFormTransformService.localTranslate(xForm, 0.3 - 0.6 * Math.random(), 0.3 - 0.6 * Math.random(), true);
      switch ((int) (Math.random() * 3.0)) {
        case 0:
          xForm.addVariation(0.05 + Math.random() * 0.15, VariationFuncList.getVariationFuncInstance("bubble", true));
          xForm.addVariation(0.01 + Math.random() * 0.5, VariationFuncList.getVariationFuncInstance(fncLst[(int) (fncLst.length * Math.random())], true));
          break;
        case 1:
          xForm.addVariation(0.05 + Math.random() * 0.15, VariationFuncList.getVariationFuncInstance("bubble", true));
          break;
        default:
          xForm.addVariation(0.05 + Math.random() * 0.15, VariationFuncList.getVariationFuncInstance(fncLst[(int) (fncLst.length * Math.random())], true));
          break;
      }

      xForm.addVariation(0.05 + Math.random() * 0.15, VariationFuncList.getVariationFuncInstance("bubble", true));
      xForm.setColor(0);
      xForm.setColorSymmetry(0.8 + Math.random() * 0.2);
    }
    // final xForm
    {
      XForm xForm = new XForm();
      layer.getFinalXForms().add(xForm);
      {
        VariationFunc varFunc;
        xForm.addVariation(0.05 + Math.random() * 0.2, VariationFuncList.getVariationFuncInstance("zscale", true));
        varFunc = VariationFuncList.getVariationFuncInstance("julia3D", true);
        varFunc.setParameter("power", Math.random() < 0.5 ? -3 : -4);
        xForm.addVariation(1, varFunc);
        varFunc = VariationFuncList.getVariationFuncInstance("pre_circlecrop", true);
        varFunc.setParameter("radius", 10000);
        varFunc.setParameter("zero", Math.random() < 0.5 ? 1 : 0);
        xForm.addVariation(1, varFunc);
      }
    }

    return flame;
View Full Code Here

    // 1st xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.5);
      VariationFunc varFunc = VariationFuncList.getVariationFuncInstance("julian", true);
      int power = Tools.FTOI(100.0 - Math.random() * 200.0);
      if (power == 0 || power == 1 || power == -1) {
        power = -30;
      }
      varFunc.setParameter("power", power);
      double amounts[] = { 0.25, 0.5, 0.75 };

      xForm.addVariation(amounts[(int) (Math.random() * amounts.length)], varFunc);
      if (Math.random() < 0.5) {
        String fncName = Math.random() > 0.5 ? getNonBlurRandomFunc() : "gaussian_blur";
View Full Code Here

            pState.updateState(pVisitor.accept(pVariation, field, property));
          }
        }
      }
    }
    VariationFunc varFunc = pVariation.getFunc();
    String[] params = varFunc.getParameterNames();
    Object[] vals = varFunc.getParameterValues();
    if (params != null) {
      for (int i = 0; i < params.length; i++) {
        if (pState.isCancelSignalled()) {
          return;
        }
View Full Code Here

      xForm.setPostCoeff11(0.70711);
      xForm.setPostCoeff20(0);
      xForm.setPostCoeff21(0);

      {
        VariationFunc varFunc = VariationFuncList.getVariationFuncInstance(VariationFuncList.getRandomVariationname(), true);
        xForm.addVariation(0.45, varFunc);
      }
    }
    // create optional linked transform 6
    if (Math.random() > 0.75) {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.05 + Math.random() * 0.2);
      xForm.setColorSymmetry(0.10 + Math.random() * 0.2);

      xForm.setCoeff00(1); // a
      xForm.setCoeff10(0); // b
      xForm.setCoeff20(0); // e
      xForm.setCoeff01(0); // c
      xForm.setCoeff11(1); // d
      xForm.setCoeff21(0); // f

      xForm.setPostCoeff00(0.70711);
      xForm.setPostCoeff10(0.70711);
      xForm.setPostCoeff01(-0.70711);
      xForm.setPostCoeff11(0.70711);
      xForm.setPostCoeff20(0);
      xForm.setPostCoeff21(0);

      xForm.getModifiedWeights()[5] = 0;

      xForm5.getModifiedWeights()[0] = 0;
      xForm5.getModifiedWeights()[1] = 0;
      xForm5.getModifiedWeights()[2] = 0;
      xForm5.getModifiedWeights()[3] = 0;
      xForm5.getModifiedWeights()[4] = 0;

      {
        VariationFunc varFunc = VariationFuncList.getVariationFuncInstance(VariationFuncList.getRandomVariationname(), true);
        xForm.addVariation(0.1 + Math.random() * 0.6, varFunc);
      }
    }
    // create final transform 1
    {
View Full Code Here

    flame.setCamPerspective(0.0);
    flame.setPixelsPerUnit(200);
    layer.getFinalXForms().clear();
    layer.getXForms().clear();

    VariationFunc varFunc;
    // 1st xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.5 + 0.4 * Math.random());
      String fncName = FNCLST_TX1[(int) (FNCLST_TX1.length * Math.random())];
      varFunc = VariationFuncList.getVariationFuncInstance(fncName, true);
      xForm.addVariation(1.0, varFunc);
      XFormTransformService.rotate(xForm, Math.random() < 0.5 ? 90.0 : -90.0, false);
      xForm.setColor(0.60 + Math.random() * 0.20);
      xForm.setColorSymmetry(Math.random() * 0.2);
    }
    // 2nd xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.5);
      varFunc = VariationFuncList.getVariationFuncInstance("splits", true);
      if (Math.random() < 0.25) {
        varFunc.setParameter("x", -0.5 + Math.random() * 1.0);
        varFunc.setParameter("y", -0.5 + Math.random() * 1.0);
      }
      else {
        varFunc.setParameter("x", -1.0 + Math.random() * 4.0);
        varFunc.setParameter("y", 0.0);
      }
      xForm.addVariation(1.0, varFunc);
      XFormTransformService.scale(xForm, 0.6 + Math.random() * 0.8, true, true, false);
      XFormTransformService.scale(xForm, 1.0 + Math.random() * 0.8, true, true, true);
      xForm.setColor(0.40 + Math.random() * 0.20);
 
View Full Code Here

      xForm.setCoeff10(-0.6439505508593787);
      xForm.setCoeff11(0.17254603006834707);
      xForm.setCoeff20(-3.0);
      xForm.setCoeff21(0.3);
      {
        VariationFunc varFunc;
        varFunc = VariationFuncList.getVariationFuncInstance("curl3D", true);
        varFunc.setParameter("cx", -0.2 + 0.4 * Math.random());
        varFunc.setParameter("cy", 0);
        varFunc.setParameter("cz", 0);
        xForm.addVariation(1, varFunc);
      }
      xForm.setColor(Math.random());
      xForm.setColorSymmetry(0);
    }
View Full Code Here

    // 1st xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(1.5 + Math.random() * 1.0);
      VariationFunc varFunc = VariationFuncList.getVariationFuncInstance("curl", true);
      varFunc.setParameter("c1", -1.0);
      varFunc.setParameter("c2", 0.001 + Math.random() * 0.0199);
      xForm.addVariation(1.6 + Math.random() * 0.8, varFunc);

      xForm.setColor(0.4 + Math.random() * 0.2);
      xForm.setColorSymmetry(0.82 + Math.random() * 0.16);
      XFormTransformService.rotate(xForm, 180, false);
      XFormTransformService.localTranslate(xForm, 1.0, 0.0, true);

      xForm.getModifiedWeights()[0] = 0.0;
      xForm.getModifiedWeights()[1] = 1.0;
      xForm.getModifiedWeights()[2] = 0.0;
      xForm.getModifiedWeights()[3] = 0.0;
    }
    // 2nd xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.05 + Math.random() * 0.35);
      String fncNames[] = { "juliascope", "julia3D", "julia3Dz", "julian" };
      VariationFunc varFunc = VariationFuncList.getVariationFuncInstance(fncNames[(int) (fncNames.length * Math.random())], true);
      varFunc.setParameter("power", Math.random() < 0.33 ? 2 : Math.random() < 0.5 ? 3 : 4);
      xForm.addVariation(1.0, varFunc);
      xForm.setColor(0.5 + Math.random() * 0.5);
      xForm.setColorSymmetry(0.5);
      xForm.getModifiedWeights()[0] = 1.0;
      xForm.getModifiedWeights()[1] = 0.0;
View Full Code Here

TOP

Related Classes of org.jwildfire.create.tina.variation.VariationFunc

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.