Package org.jwildfire.create.tina.base

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


    layer.getFinalXForms().clear();
    layer.getXForms().clear();
    // init
    // 1st XForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.4 + Math.random() * 50.0);

      String fName = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL[(int) (Math.random() * ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL.length)];
      xForm.addVariation(0.01 + 0.4 * Math.random(), VariationFuncList.getVariationFuncInstance(fName, true));
      xForm.addVariation(0.12 + 0.3 * Math.random(), VariationFuncList.getVariationFuncInstance("linear3D", true));
      xForm.setColor(0.87 + Math.random() * 0.1);
    }
    // 2nd XForm
    boolean twoPrimaryXForms = Math.random() > 0.33;
    boolean linkedXForms = Math.random() < 0.25;
    if (twoPrimaryXForms) {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.4 + Math.random() * 150.0);

      xForm.addVariation(1.0, VariationFuncList.getVariationFuncInstance(VariationFuncList.getRandomVariationname(), true));
      xForm.setColorSymmetry(-1);
      xForm.setColor(0.89 + Math.random() * 0.06);
      XFormTransformService.scale(xForm, 0.75 + Math.random() * 0.25, Math.random() > 0.125, Math.random() < 0.875);
      XFormTransformService.rotate(xForm, -180.0 + Math.random() * 360.0);
    }
    // Tiling
    int nForms = 2 + (int) (Math.random() * 5);
    for (int i = 0; i < nForms; i++) {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.25 + Math.random() * 0.5);
      xForm.addVariation(1.0, VariationFuncList.getVariationFuncInstance("linear3D", true));
      if (Math.random() > 0.75) {
        XFormTransformService.scale(xForm, 0.25 + Math.random() * 0.75, Math.random() > 0.25, Math.random() < 0.75);
      }
      else {
        XFormTransformService.scale(xForm, 0.75 + Math.random() * 0.25, Math.random() > 0.25, Math.random() < 0.25);
      }
      XFormTransformService.rotate(xForm, Math.random() * 360.0);
      XFormTransformService.localTranslate(xForm, -2.0 + Math.random() * 4.0, -2.0 + Math.random() * 4.0);
      xForm.setColor(Math.random());
    }
    if (linkedXForms) {
      for (int i = 0; i < layer.getXForms().size(); i++) {
        if (i == 0) {
          for (int j = 0; j < layer.getXForms().size(); j++) {
View Full Code Here


  @Override
  public void prepare(FlameTransformationContext pFlameTransformationContext, AbstractRandomGenerator pRandGen, double pCamDOF_10) {
    super.prepare(pFlameTransformationContext, pRandGen, pCamDOF_10);
    s = new XYZPoint();
    d = new XYZPoint();
    xform = new XForm();
    fnc = new SquareFunc();
    fnc.init(pFlameTransformationContext, new Layer(), xform, 1.0);
    width = params.get(PARAM_WIDTH);
  }
View Full Code Here

    Layer layer = flame.getFirstLayer();
    layer.getFinalXForms().clear();
    layer.getXForms().clear();
    // 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;
      xForm.getModifiedWeights()[2] = 1.0;
      xForm.getModifiedWeights()[3] = 1.0;
    }

    // 3rd xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.4 + Math.random() * 0.2);
      String fncName;
      if (Math.random() < 0.33) {
        fncName = "bubble";
      }
      else {
        fncName = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL[(int) (ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL.length * Math.random())];
      }
      xForm.addVariation(0.01 + Math.random() * 0.04, VariationFuncList.getVariationFuncInstance(fncName, true));
      xForm.addVariation(5.0 + Math.random() * 10.0, VariationFuncList.getVariationFuncInstance("pre_blur", true));
      xForm.setColor(0.1 + Math.random() * 0.3);
      xForm.setColorSymmetry(0);
      XFormTransformService.localTranslate(xForm, -1.0, 0.0, true);
      xForm.getModifiedWeights()[0] = 1.0;
      xForm.getModifiedWeights()[1] = 1.0;
      xForm.getModifiedWeights()[2] = 0.0;
      xForm.getModifiedWeights()[3] = 0.0;

    }
    // 4th xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.4 + Math.random() * 0.2);
      String fncName = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL[(int) (ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL.length * Math.random())];
      xForm.addVariation(0.01 + Math.random() * 0.04, VariationFuncList.getVariationFuncInstance(fncName, true));
      xForm.setColor(0.1 + Math.random() * 0.3);
      xForm.setColorSymmetry(0);
      XFormTransformService.rotate(xForm, Math.random() * 360.0, true);
      XFormTransformService.scale(xForm, 1.1 + Math.random() * 3.0, true, true, true);
      xForm.getModifiedWeights()[0] = 1.0;
      xForm.getModifiedWeights()[1] = 1.0;
      xForm.getModifiedWeights()[2] = 1.0;
      xForm.getModifiedWeights()[3] = 1.0;

    }

    return flame;
  }
View Full Code Here

    @Override
    public Flame postProcessFlame(Flame pFlame) {
      Layer layer = pFlame.getFirstLayer();
      int idx = Math.random() < 0.25 ? 0 : 1;
      XForm xForm = layer.getXForms().get(idx);
      addImgVariation(pFlame, xForm);
      return pFlame;
    }
View Full Code Here

    @Override
    public Flame postProcessFlame(Flame pFlame) {
      Layer layer = pFlame.getFirstLayer();
      int idx = Math.random() < 0.5 ? 0 : 1;
      XForm xForm = layer.getXForms().get(idx);
      addImgVariation(pFlame, xForm);
      return pFlame;
    }
View Full Code Here

    @Override
    public Flame postProcessFlame(Flame pFlame) {
      Layer layer = pFlame.getFirstLayer();
      int idx = (int) (Math.random() * 3.0);
      XForm xForm = layer.getXForms().get(idx);
      addImgVariation(pFlame, xForm);
      return pFlame;
    }
View Full Code Here

    @Override
    public Flame postProcessFlame(Flame pFlame) {
      Layer layer = pFlame.getFirstLayer();
      int idx = Math.random() < 0.5 ? 0 : 1;
      XForm xForm = layer.getXForms().get(idx);
      addImgVariation(pFlame, xForm);
      return pFlame;
    }
View Full Code Here

    @Override
    public Flame postProcessFlame(Flame pFlame) {
      Layer layer = pFlame.getFirstLayer();
      int idx = 0;
      XForm xForm = layer.getXForms().get(idx);
      addImgVariation(pFlame, xForm);
      return pFlame;
    }
View Full Code Here

    @Override
    public Flame postProcessFlame(Flame pFlame) {
      Layer layer = pFlame.getFirstLayer();
      int idx = Math.random() < 0.6 ? 0 : 1;
      XForm xForm = layer.getXForms().get(idx);
      addImgVariation(pFlame, xForm);
      return pFlame;
    }
View Full Code Here

    @Override
    public Flame postProcessFlame(Flame pFlame) {
      Layer layer = pFlame.getFirstLayer();
      int idx = Math.random() < 0.5 ? 0 : 1;
      XForm xForm = layer.getXForms().get(idx);
      addImgVariation(pFlame, xForm);
      return pFlame;
    }
View Full Code Here

TOP

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

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.