Package org.jwildfire.create.tina.base

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


    Pseudo3DRenderThreadPersistentState state = (Pseudo3DRenderThreadPersistentState) pState;
    currSample = state.currSample;
    startIter = state.startIter;
    for (Pseudo3DRenderThreadPersistentState.IterationState persist : state.getLayerState()) {
      RenderPacket packet = renderPackets.get(persist.packetIdx);
      Layer layer = packet.getFlame().getLayers().get(persist.layerIdx);
      Pseudo3DRenderIterationState restored = (Pseudo3DRenderIterationState) createState(packet, layer);
      restored.xf = (persist.xfIndex >= 0) ? restored.layer.getXForms().get(persist.xfIndex) : null;
      restored.q = persist.q != null ? persist.q.makeCopy() : null;
      restored.affineTA = copyXYZPointArray(persist.affineTA);
      restored.varTA = copyXYZPointArray(persist.varTA);
View Full Code Here


      "spherical", "spiral", "stripes", "unpolar", "waves2", "whorl", "xheart" };

  @Override
  protected Flame prepareFlame(RandomFlameGeneratorState pState) {
    Flame flame = new Flame();
    Layer layer = flame.getFirstLayer();
    flame.setCentreX(0.0);
    flame.setCentreY(0.45);
    flame.setCamPitch(49.0);
    flame.setCamRoll(00.0);
    flame.setCamYaw(0.0);
    flame.setCamZoom(1.0);
    flame.setGamma(2.0);
    flame.setCamPerspective(0.05 + Math.random() * 0.12);
    flame.setPixelsPerUnit(200);
    layer.getFinalXForms().clear();
    layer.getXForms().clear();
    flame.setPreserveZ(true);

    VariationFunc varFunc;
    // 1st xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.5);
      int varId = (int) (Math.random() * 6.0);
      switch (varId) {
        case 0:
          varFunc = VariationFuncList.getVariationFuncInstance("fract_dragon_wf", true);
          varFunc.setParameter("scale", 2.0);
          varFunc.setParameter("xmin", -2.0);
          varFunc.setParameter("xmax", 2.0);
          varFunc.setParameter("ymin", -2.0);
          varFunc.setParameter("ymax", 2.0);
          varFunc.setParameter("xseed", -1.0 + 2.0 * Math.random());
          varFunc.setParameter("yseed", -1.0 + 2.0 * Math.random());
          break;
        case 1:
          varFunc = VariationFuncList.getVariationFuncInstance("fract_julia_wf", true);
          varFunc.setParameter("scale", 2.0);
          varFunc.setParameter("xmin", -2.0);
          varFunc.setParameter("xmax", 2.0);
          varFunc.setParameter("ymin", -2.0);
          varFunc.setParameter("ymax", 2.0);
          varFunc.setParameter("xseed", -1.0 + 2.0 * Math.random());
          varFunc.setParameter("yseed", -1.0 + 2.0 * Math.random());
          break;
        case 2:
          varFunc = VariationFuncList.getVariationFuncInstance("fract_pearls_wf", true);
          varFunc.setParameter("scale", 2.0);
          varFunc.setParameter("xmin", -2.0);
          varFunc.setParameter("xmax", 2.0);
          varFunc.setParameter("ymin", -2.0);
          varFunc.setParameter("ymax", 2.0);
          varFunc.setParameter("xseed", -1.0 + 2.0 * Math.random());
          varFunc.setParameter("yseed", -1.0 + 2.0 * Math.random());
          break;
        case 3:
          varFunc = VariationFuncList.getVariationFuncInstance("fract_salamander_wf", true);
          varFunc.setParameter("scale", 2.0);
          varFunc.setParameter("xmin", -2.0);
          varFunc.setParameter("xmax", 2.0);
          varFunc.setParameter("ymin", -2.0);
          varFunc.setParameter("ymax", 2.0);
          varFunc.setParameter("xseed", -1.0 + 2.0 * Math.random());
          varFunc.setParameter("yseed", -1.0 + 2.0 * Math.random());
          break;
        case 4:
          varFunc = VariationFuncList.getVariationFuncInstance("fract_mandelbrot_wf", true);
          break;
        default:
          varFunc = VariationFuncList.getVariationFuncInstance("fract_meteors_wf", true);
          break;
      }
      if (Math.random() < 0.8) {
        double scale = 3 + Math.random() * 3;
        double xmin = -1.0 + 2.0 * Math.random();
        double ymin = -1.0 + 2.0 * Math.random();
        double xmax = xmin + 4.0 / scale;
        double ymax = ymin + 4.0 / scale;

        varFunc.setParameter("xmin", xmin);
        varFunc.setParameter("xmax", xmax);
        varFunc.setParameter("ymin", ymin);
        varFunc.setParameter("ymax", ymax);
        varFunc.setParameter("offsetx", -(xmax - xmin) * 0.5);
        varFunc.setParameter("offsety", -(ymax - ymin) * 0.5);
        varFunc.setParameter("scale", 2.0 * scale);

      }
      varFunc.setParameter("scalez", 1.0 + Math.random() * 10.0);
      xForm.addVariation(1.0, varFunc);
    }
    // final
    if (Math.random() < 0.75) {
      XForm xForm = new XForm();
      layer.getFinalXForms().add(xForm);
      varFunc = VariationFuncList.getVariationFuncInstance(FNCLST_FINAL[(int) (Math.random() * FNCLST_FINAL.length)], true);
      xForm.addVariation(1.0, varFunc);
    }
    flame.getFirstLayer().randomizeColors();
    return flame;
View Full Code Here

    flame.setPreserveZ(true);
    if (Math.random() < 0.5) {
      flame.setCamDOF(0.1 + Math.random() * 0.2);
    }

    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) {
View Full Code Here

public class TentacleRandomFlameGenerator extends RandomFlameGenerator {

  @Override
  protected Flame prepareFlame(RandomFlameGeneratorState pState) {
    Flame flame = new Flame();
    Layer layer = flame.getFirstLayer();
    flame.setCentreX(0.0);
    flame.setCentreY(0.0);
    flame.setPixelsPerUnit(200);
    layer.getFinalXForms().clear();
    layer.getXForms().clear();
    int maxXFormsX = (int) (2.0 + Math.random() * 3.0);
    int maxXFormsY = (int) (2.0 + Math.random() * 3.0);
    double xMin = -(double) maxXFormsX * 0.5;
    double yMin = -(double) maxXFormsY * 0.5 + 1;

    String[] fnc = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL;

    double scl = 1.0;
    for (int y = 0; y < maxXFormsY; y++) {
      for (int x = 0; x < maxXFormsX; x++) {
        XForm xForm = new XForm();
        xForm.setWeight(0.5 + Math.random() * 99.5);
        layer.getXForms().add(xForm);
        XFormTransformService.globalTranslate(xForm, xMin + x, yMin + y, false);
        if (Math.random() < 0.5) {
          XFormTransformService.rotate(xForm, 360.0 * Math.random(), true);
        }
        else {
View Full Code Here

public class DuckiesRandomFlameGenerator extends RandomFlameGenerator {

  @Override
  protected Flame prepareFlame(RandomFlameGeneratorState pState) {
    Flame flame = new Flame();
    Layer layer = flame.getFirstLayer();
    flame.setCentreX(0.0);
    flame.setCentreY(0.0);
    flame.setPixelsPerUnit(200);
    layer.getFinalXForms().clear();
    layer.getXForms().clear();
    // 1st xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.5 + Math.random());
      xForm.addVariation(1.5 + Math.random(), VariationFuncList.getVariationFuncInstance(Math.random() < 0.12 ? VariationFuncList.getRandomVariationname() : "spherical", true));
      xForm.setColorSymmetry(-0.5);

      XFormTransformService.localTranslate(xForm, 0.75 - 5.50 * Math.random(), 0.75 - 1.50 * Math.random(), false);
      XFormTransformService.rotate(xForm, -60.0 + Math.random() * 30.0, false);
      XFormTransformService.scale(xForm, 0.1 + Math.random() * 0.4, true, true, false);

    }
    // 2nd xForm
    {
      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);

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

      if (Math.random() > 0.667) {
        xForm = new XForm();
        layer.getXForms().add(xForm);
        xForm.setWeight(0.50 + Math.random() * 50.0);
        varFunc = VariationFuncList.getVariationFuncInstance(VariationFuncList.getRandomVariationname(), true);
        xForm.addVariation(0.125 + 0.75 * Math.random(), varFunc);

        XFormTransformService.rotate(xForm, -24.0 + Math.random() * 48.0, true);
        XFormTransformService.localTranslate(xForm, -0.25 + Math.random() * 0.5, -0.25 + Math.random() * 0.5, true);
        XFormTransformService.scale(xForm, 0.5 + Math.random() * 0.25, true, true, true);

        layer.getXForms().get(0).getModifiedWeights()[2] = 0.0;
        layer.getXForms().get(2).getModifiedWeights()[2] = 0.0;
        layer.getXForms().get(1).getModifiedWeights()[3] = 0.0;
        layer.getXForms().get(2).getModifiedWeights()[3] = 0.0;
        layer.getXForms().get(3).getModifiedWeights()[3] = 0.0;
      }
    }

    flame.getFirstLayer().randomizeColors();
    return flame;
View Full Code Here

public class Flowers3DRandomFlameGenerator extends RandomFlameGenerator {

  @Override
  protected Flame prepareFlame(RandomFlameGeneratorState pState) {
    Flame flame = new Flame();
    Layer layer = flame.getFirstLayer();
    flame.setCentreX(0.0);
    flame.setCentreY(0.0);
    flame.setCamPitch(49.0);
    flame.setCamYaw(12.0);
    flame.setPixelsPerUnit(200);
    layer.getFinalXForms().clear();
    layer.getXForms().clear();
    //    int fncCount = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL.length;
    // 1st xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.5 + Math.random());
      xForm.addVariation(0.5, VariationFuncList.getVariationFuncInstance("gaussian_blur", true));
      xForm.setColor(0.0);
      xForm.setColorSymmetry(0.0);
    }
    // 2nd xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(3.0 + Math.random() * 10.0);
      if (Math.random() < 0.33) {
        xForm.addVariation(1.0, VariationFuncList.getVariationFuncInstance("linear3D", true));
      }
      else {
        VariationFunc f = VariationFuncList.getVariationFuncInstance("linearT3D", true);
        double x = 2.0 * Math.random() - 0.5;
        f.setParameter("powX", x);
        f.setParameter("powY", x);
        f.setParameter("powZ", 2.0 * Math.random() - 0.5);
        xForm.addVariation(1.0, f);
      }
      xForm.addVariation(0.1 + Math.random() * 0.3, VariationFuncList.getVariationFuncInstance("spherical", true));
      xForm.addVariation(0.2 + Math.random() * 0.9, VariationFuncList.getVariationFuncInstance("zcone", true));
      xForm.addVariation(0.01 + 0.045 * Math.random(), VariationFuncList.getVariationFuncInstance("cross", true));
      if (Math.random() < 0.33) {
        VariationFunc ef = VariationFuncList.getVariationFuncInstance("epispiral_wf", true);
        ef.setParameter("waves", 3 + (int) (Math.random() * 10.0));
        xForm.addVariation(0.02 + 0.29 * Math.random(), ef);
        if (Math.random() < 0.33) {
          VariationFunc ef2 = VariationFuncList.getVariationFuncInstance("epispiral", true);
          ef2.setParameter("thickness", 0.05 + Math.random() * 0.15);
          ef2.setParameter("n", 3.0 + Math.random() * 10.0);
          xForm.addVariation(0.01 + 0.14 * Math.random(), ef2);
        }
      }
      xForm.setColor(Math.random());
      xForm.setColorSymmetry(Math.random());
      XFormTransformService.scale(xForm, 1.0 + (0.1 - Math.random() * 0.2), true, true, false);
      XFormTransformService.rotate(xForm, 45.0 - Math.random() * 90.0, false);
      XFormTransformService.localTranslate(xForm, 0.01 - 0.02 * Math.random(), 0.01 - 0.02 * Math.random(), false);
    }
    // 3rd xForm
    boolean advStructure = Math.random() > 0.25;
    if (advStructure) {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.3 + Math.random() * 0.3);
      VariationFunc varFunc = VariationFuncList.getVariationFuncInstance("blob3D", true);
      varFunc.setParameter("low", 0.1);
      varFunc.setParameter("high", 0.3);
      varFunc.setParameter("waves", 9.0);
      xForm.addVariation(0.05, varFunc);
      xForm.setColor(0.0);
      xForm.setColorSymmetry(1.0);
      // 4th xForm
    }
    if (advStructure && Math.random() > 0.25) {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.1 + Math.random() * 0.3);
      xForm.addVariation(0.5, VariationFuncList.getVariationFuncInstance("blur3D", true));
      xForm.addVariation(15.0, VariationFuncList.getVariationFuncInstance("ztranslate", true));
      xForm.setColor(0.0);
      xForm.setColorSymmetry(1.0);
    }
    // final xForm
    {
      XForm xForm = new XForm();
      layer.getFinalXForms().add(xForm);
      VariationFunc varFunc = VariationFuncList.getVariationFuncInstance("julia3D", true);
      double power = -2.0;
      if (Math.random() < 0.25) {
        power -= Math.random() * 4.0;
      }
View Full Code Here

public class FilledFlowers3DRandomFlameGenerator extends RandomFlameGenerator {

  @Override
  protected Flame prepareFlame(RandomFlameGeneratorState pState) {
    Flame flame = new Flame();
    Layer layer = flame.getFirstLayer();
    flame.setCentreX(0);
    flame.setCentreY(0);
    flame.setCamPitch(37);
    flame.setCamRoll(0);
    flame.setCamYaw(0);
    flame.setPixelsPerUnit(200);
    flame.setCamZoom(2.0);
    flame.setCamPerspective(0.32);
    layer.getFinalXForms().clear();
    layer.getXForms().clear();
    // 1st xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.25 + Math.random() * 0.5);
      {
        xForm.addVariation(0.25 + Math.random() * 0.5, VariationFuncList.getVariationFuncInstance("gaussian_blur", true));
      }
      xForm.setColor(0);
      xForm.setColorSymmetry(0);
    }
    // 2nd xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(1 + Math.random() * 50.0);

      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);
View Full Code Here

public class ExperimentalBubbles3DRandomFlameGenerator extends Bubbles3DRandomFlameGenerator {

  @Override
  protected Flame prepareFlame(RandomFlameGeneratorState pState) {
    Flame flame = super.prepareFlame(pState);
    Layer layer = flame.getFirstLayer();
    // modify last xForm
    {
      XForm xForm = layer.getXForms().get(layer.getXForms().size() - 1);
      XFormTransformService.scale(xForm, 0.5 + 5.0 * Math.random(), Math.random() < 0.75, Math.random() < 0.75, false);
      XFormTransformService.rotate(xForm, 180.0 - Math.random() * 360.0, false);
      XFormTransformService.localTranslate(xForm, 4.0 - 8.0 * Math.random(), 4.0 - 8.0 * Math.random(), false);
    }
    return flame;
View Full Code Here

  }

  @Override
  protected Flame prepareFlame(RandomFlameGeneratorState pState) {
    Flame flame = new Flame();
    Layer layer = flame.getFirstLayer();
    flame.setCentreX(0.0);
    flame.setCentreY(0.0);
    flame.setCamPitch(0.0);
    flame.setCamYaw(0.0);
    flame.setCamZoom(1.0);
    flame.setCamPerspective(0.0);
    flame.setPixelsPerUnit(100);
    layer.getFinalXForms().clear();
    layer.getXForms().clear();
    // 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";
        xForm.addVariation(0.001 + Math.random() * 0.039, VariationFuncList.getVariationFuncInstance(fncName, true));
      }
      xForm.setColorSymmetry(-1.0);
      xForm.setColor(0.0);
    }
    // 2nd xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(2.0 + Math.random() * 24.0);
      xForm.addVariation(1.0, VariationFuncList.getVariationFuncInstance("disc", true));
      if (Math.random() < 0.125) {
        String fncName = Math.random() > 0.5 ? getNonBlurRandomFunc() : "gaussian_blur";
        xForm.addVariation(0.001 + Math.random() * 0.039, VariationFuncList.getVariationFuncInstance(fncName, true));
      }
      xForm.setColor(0.5 + Math.random() * 0.5);
      xForm.setColorSymmetry(0.6 + Math.random() * 0.33);
      if (Math.random() < 0.33) {
        XFormTransformService.globalTranslate(xForm, -0.0125 + 0.025 * Math.random(), -0.0125 + 0.025 * Math.random(), false);
      }
      else if (Math.random() < 0.75) {
        XFormTransformService.globalTranslate(xForm, -0.125 + 0.25 * Math.random(), -0.125 + 0.25 * Math.random(), false);
      }
      if (Math.random() < 0.15) {
        XFormTransformService.rotate(xForm, 6.0 - Math.random() * 12.0, false);
      }
      else if (Math.random() < 0.3) {
        XFormTransformService.rotate(xForm, -45.0, false);
      }
      else if (Math.random() < 0.75) {
        XFormTransformService.rotate(xForm, 90.0 - Math.random() * 180.0, false);
      }
      xForm.setColorSymmetry(Math.random());
    }
    // final
    if (Math.random() < 0.15) {
      XForm xForm = new XForm();
      layer.getFinalXForms().add(xForm);
      if (Math.random() < 0.5) {
        String[] fncList = { "auger", "bent", "bent2", "boarders", "bubble", "butterfly", "bwraps7", "cosine",
            "curve", "cylinder", "diamond", "disc", "eclipse", "edisc", "elliptic", "ex", "exp", "exponential",
            "eyefish", "fan", "fan2", "fisheye", "heart_wf", "hemisphere", "horseshoe", "hyperbolic", "julia",
            "julia3D", "julia3Dz", "julian", "juliascope", "linearT", "log", "mobius", "ngon", "oscilloscope",
View Full Code Here

    return new BrokatRandomFlameGenerator();
  }

  @Override
  protected Flame preProcessFlame(Flame pFlame) {
    Layer layer = pFlame.getFirstLayer();
    for (XForm xForm : layer.getXForms()) {
      if (Math.random() > 0.33 && !xForm.hasVariation("flatten")) {
        xForm.addVariation(1.0, VariationFuncList.getVariationFuncInstance("flatten", true));
      }
    }
    return pFlame;
View Full Code Here

TOP

Related Classes of org.jwildfire.create.tina.base.Layer

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.