Package org.jwildfire.create.tina.base

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


    layer.getXForms().clear();

    VariationFunc varFunc;
    // 1st xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(4.0 + 12.0 * Math.random());
      varFunc = VariationFuncList.getVariationFuncInstance("spherical3D", true);
      xForm.addVariation(1.0, varFunc);
      //      XFormTransformService.rotate(xForm, Math.random() < 0.5 ? 90.0 : -90.0, false);
      XFormTransformService.rotate(xForm, Math.random() < 0.5 ? Math.random() < 0.5 ? 180.0 : 90 : -90.0, false);
      XFormTransformService.globalTranslate(xForm, 1.0, 0.0, false);

      xForm.setColor(1.0);
      xForm.setColorSymmetry(0.9 + Math.random() * 0.2);
    }
    // 2nd xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(3.0 + 11.0 * Math.random());
      varFunc = VariationFuncList.getVariationFuncInstance("spherical3D", true);
      xForm.addVariation(1.0, varFunc);
      //      XFormTransformService.rotate(xForm, 90.0, false);
      XFormTransformService.rotate(xForm, Math.random() < 0.5 ? Math.random() < 0.5 ? 180.0 : 90 : -90.0, false);

      xForm.setColor(0.5);
      xForm.setColorSymmetry(0.9 + Math.random() * 0.2);
    }
    // 3rd xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.3 + 0.2 * Math.random());
      varFunc = VariationFuncList.getVariationFuncInstance("linear3D", true);
      xForm.addVariation(1.0, varFunc);
      XFormTransformService.rotate(xForm, 90.0, false);
      XFormTransformService.globalTranslate(xForm, (int) (2.0 + Math.random() * 2.0), 0.0, false);
      xForm.setColor(Math.random());
      xForm.setColorSymmetry(0);
    }
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.2 + 0.15 * Math.random());
      varFunc = VariationFuncList.getVariationFuncInstance("linear3D", true);
      xForm.addVariation(1.0, varFunc);
      XFormTransformService.rotate(xForm, 90.0, false);
      XFormTransformService.globalTranslate(xForm, -(int) (2.0 + Math.random() * 2.0), 0.0, false);
      xForm.setColor(Math.random());
      xForm.setColorSymmetry(0);
    }

    int max = (int) (Math.random() * 4.0);
    for (int i = 0; i < max; i++) {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.5 + 0.3 * Math.random());
      String fncName = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL[(int) (ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL.length * Math.random())];

      varFunc = VariationFuncList.getVariationFuncInstance(fncName, true);
      xForm.addVariation(1.0, varFunc);
      XFormTransformService.rotate(xForm, 90.0 - Math.random() * 180.0, false);
      XFormTransformService.scale(xForm, 0.2 + 0.2 * Math.random(), true, true);
      XFormTransformService.globalTranslate(xForm, 0.25 - Math.random() * 0.5, 0.25 - Math.random() * 0.5, false);
      xForm.setColor(Math.random());
      xForm.setColorSymmetry(0);
    }
    flame.getFirstLayer().randomizeColors();

    return flame;
  }
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 SineBlurFunc();
    for (String paramName : getParamNames()) {
      fnc.setParameter(paramName, params.get(paramName));
    }
    fnc.init(pFlameTransformationContext, new Layer(), xform, 1.0);
View Full Code Here

    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);
    }
    // 3th xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.2 + 0.4 * Math.random());
      String fncName = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL[(int) (ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL.length * Math.random())];
      //String fncName = Math.random() < 0.5 ? "linear" : "cylinder";
      varFunc = VariationFuncList.getVariationFuncInstance(fncName, true);
      xForm.addVariation(1.0, varFunc);
      //      XFormTransformService.scale(xForm, 5.0 + Math.random() * 10.0, false, true, true);
      //      XFormTransformService.scale(xForm, 0.5 + Math.random() * 0.75, true, false, true);
      //      XFormTransformService.scale(xForm, 0.2 + Math.random() * 0.8, true, true, false);
      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);
    }
    // 4th xForm
    {
      XForm xForm = new XForm();
      layer.getXForms().add(xForm);
      xForm.setWeight(0.3 + 0.8 * Math.random());
      //String fncName = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL[(int) (ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL.length * Math.random())];
      String fncName = Math.random() < 0.5 ? "noise" : "cylinder";
      varFunc = VariationFuncList.getVariationFuncInstance(fncName, true);
      xForm.addVariation(1.0, varFunc);
      XFormTransformService.scale(xForm, 5.0 + Math.random() * 10.0, false, true, true);
      XFormTransformService.scale(xForm, 0.5 + Math.random() * 0.75, true, false, true);
      XFormTransformService.scale(xForm, 0.2 + Math.random() * 0.8, true, true, false);
      xForm.setColor(0.60 + Math.random() * 0.20);
      xForm.setColorSymmetry(Math.random() * 0.2);
    }
    //    flame.randomizeColors();
    return flame;
  }
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.