"whorl", "xheart" };
@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.setCamRoll(00.0);
flame.setCamYaw(0.0);
flame.setCamZoom(2.0);
flame.setGamma(2.7);
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);
}
// 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);