// variation 1
xForm.addVariation(0.125 + Math.random() * 0.125, VariationFuncList.getVariationFuncInstance("linear", true));
// variation 2
{
VariationFunc varFunc = VariationFuncList.getVariationFuncInstance("julian", true);
varFunc.setParameter("power", 3);
varFunc.setParameter("dist", 1);
xForm.addVariation(0.6 + Math.random() * 0.4, varFunc);
}
// variation 3
{
VariationFunc varFunc = VariationFuncList.getVariationFuncInstance("juliascope", true);
varFunc.setParameter("power", 6);
varFunc.setParameter("dist", 1);
xForm.addVariation(0.6 + Math.random() * 0.3, varFunc);
}
XFormTransformService.localTranslate(xForm, 1.0 - 2.0 * Math.random(), 1.0 - 2.0 * Math.random(), false);
XFormTransformService.scale(xForm, 0.9 + Math.random() * 0.5, true, true, false);
XFormTransformService.rotate(xForm, 360.0 * Math.random(), false);
}
// create transform 2
{
XForm xForm = new XForm();
layer.getXForms().add(xForm);
xForm.setWeight(0.23272111);
xForm.setColor(0.8);
xForm.setColorSymmetry(0);
xForm.setCoeff00(-0.15514012); // a
xForm.setCoeff10(0.20816567); // b
xForm.setCoeff20(0.19004075); // e
xForm.setCoeff01(-0.15087636); // c
xForm.setCoeff11(0.20174952); // d
xForm.setCoeff21(-0.04671182); // f
xForm.setPostCoeff00(1);
xForm.setPostCoeff10(0);
xForm.setPostCoeff01(0);
xForm.setPostCoeff11(1);
xForm.setPostCoeff20(0);
xForm.setPostCoeff21(0);
// variation 1
xForm.addVariation(1, VariationFuncList.getVariationFuncInstance("linear", true));
// variation 2
{
VariationFunc varFunc = VariationFuncList.getVariationFuncInstance("juliascope", true);
varFunc.setParameter("power", 2);
varFunc.setParameter("dist", 1);
xForm.addVariation(0.25 + Math.random() * 0.5, varFunc);
}
String fName;
if (Math.random() < 0.33) {
int idx = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL.length;
fName = ExperimentalSimpleRandomFlameGenerator.FNCLST_EXPERIMENTAL[(int) (Math.random() * idx)];
}
else {
fName = VariationFuncList.getRandomVariationname();
}
xForm.addVariation(0.18 - Math.random() * 0.36, VariationFuncList.getVariationFuncInstance(fName, true));
XFormTransformService.localTranslate(xForm, 1.0 - 2.0 * Math.random(), 1.0 - 2.0 * Math.random(), false);
XFormTransformService.scale(xForm, 0.9 + Math.random() * 0.5, true, true, false);
XFormTransformService.rotate(xForm, 360.0 * Math.random(), false);
}
// create transform 3
{
XForm xForm = new XForm();
layer.getXForms().add(xForm);
xForm.setWeight(0.04166667);
xForm.setColor(0.1);
xForm.setColorSymmetry(0.75);
xForm.setCoeff00(0.92931929); // a
xForm.setCoeff10(0.17076568); // b
xForm.setCoeff20(0.15869232); // e
xForm.setCoeff01(-0.02999303); // c
xForm.setCoeff11(0.67104838); // d
xForm.setCoeff21(-0.19510192); // f
xForm.setPostCoeff00(1);
xForm.setPostCoeff10(0);
xForm.setPostCoeff01(0);
xForm.setPostCoeff11(1);
xForm.setPostCoeff20(0);
xForm.setPostCoeff21(0);
// variation 1
xForm.addVariation(1, VariationFuncList.getVariationFuncInstance("linear", true));
}
// create transform 4
{
XForm xForm = new XForm();
layer.getXForms().add(xForm);
xForm.setWeight(0.04166667);
xForm.setColor(0.15);
xForm.setColorSymmetry(0.75);
xForm.setCoeff00(0.53699507); // a
xForm.setCoeff10(0.12206942); // b
xForm.setCoeff20(-0.0380713); // e
xForm.setCoeff01(0.23469299); // c
xForm.setCoeff11(0.79862481); // d
xForm.setCoeff21(0.04291273); // f
xForm.setPostCoeff00(1);
xForm.setPostCoeff10(0);
xForm.setPostCoeff01(0);
xForm.setPostCoeff11(1);
xForm.setPostCoeff20(0);
xForm.setPostCoeff21(0);
xForm.addVariation(1, VariationFuncList.getVariationFuncInstance("linear", true));
}
// create transform 5
{
XForm xForm = new XForm();
layer.getXForms().add(xForm);
xForm.setWeight(0.04166667);
xForm.setColor(0.2);
xForm.setColorSymmetry(0);
xForm.setCoeff00(0.89779523); // a
xForm.setCoeff10(-0.23112747); // b
xForm.setCoeff20(-0.4497571); // e
xForm.setCoeff01(0.1734196); // c
xForm.setCoeff11(0.94619577); // d
xForm.setCoeff21(-0.0672393); // f
xForm.setPostCoeff00(1);
xForm.setPostCoeff10(0);
xForm.setPostCoeff01(0);
xForm.setPostCoeff11(1);
xForm.setPostCoeff20(0);
xForm.setPostCoeff21(0);
xForm.addVariation(1, VariationFuncList.getVariationFuncInstance("linear", true));
}
// create transform 6
{
XForm xForm = new XForm();
layer.getXForms().add(xForm);
xForm.setWeight(0.04166667);
xForm.setColor(0.25);
xForm.setColorSymmetry(0);
xForm.setCoeff00(0.70624241); // a
xForm.setCoeff10(0.15652237); // b
xForm.setCoeff20(0.43007701); // e
xForm.setCoeff01(-0.04953437); // c
xForm.setCoeff11(0.78838922); // d
xForm.setCoeff21(0.21371425); // f
xForm.setPostCoeff00(1);
xForm.setPostCoeff10(0);
xForm.setPostCoeff01(0);
xForm.setPostCoeff11(1);
xForm.setPostCoeff20(0);
xForm.setPostCoeff21(0);
xForm.addVariation(1, VariationFuncList.getVariationFuncInstance("linear", true));
}
// final transform
if (Math.random() > 0.33) {
XForm xForm = new XForm();
layer.getFinalXForms().add(xForm);
String finals[] = { "falloff2", "bwrands", "bwraps7", "cosine", "falloff3", "bwrands", "bwrands", "falloff2" };
VariationFunc var = VariationFuncList.getVariationFuncInstance(finals[(int) (Math.random() * finals.length)], true);
if (var.getName().equals("bwrands")) {
var.setParameter("seed", (int) (Math.random() * Short.MAX_VALUE));
var.setParameter("minpetals", (int) (3 + Math.random() * 3));
var.setParameter("maxpetals", (int) (6 + Math.random() * 12));
}
if (var.getName().equals("bwrands") || var.getName().equals("bwraps7")) {
var.setParameter("cellsize", 1.0 - Math.random() * 0.9);
var.setParameter("space", Math.random() * 0.2);
if (Math.random() > 0.5) {
var.setParameter("inner_twist", 0.2 - Math.random() * 0.4);
var.setParameter("outer_twist", 2.0 - Math.random() * 4.0);
}
}
xForm.addVariation(1, var);
}
return flame;