Search in sources :

Example 1 with LocalGammaMutation

use of org.jwildfire.create.tina.mutagen.LocalGammaMutation in project JWildfire by thargor6.

the class GalaxiesRandomFlameGenerator method prepareFlame.

@Override
public Flame prepareFlame(RandomFlameGeneratorState pState) {
    Flame flame = new Flame();
    Layer layer = flame.getFirstLayer();
    flame.setCamRoll(1.49758722);
    flame.setCamPitch(0);
    flame.setCamYaw(0);
    flame.setCamPerspective(0);
    flame.setWidth(601);
    flame.setHeight(338);
    flame.setPixelsPerUnit(92.48366013);
    flame.setCamZoom(0.72 + Math.random() * 0.42);
    flame.setCentreX(1.5357526);
    flame.setCentreY(-0.4416446);
    layer.getFinalXForms().clear();
    layer.getXForms().clear();
    // create transform 1
    {
        XForm xForm = new XForm();
        layer.getXForms().add(xForm);
        xForm.setWeight(25.75871591);
        xForm.setColor(0.74488914);
        xForm.setColorSymmetry(0);
        // a
        xForm.setCoeff00(1);
        // b
        xForm.setCoeff10(0);
        // e
        xForm.setCoeff20(1.09171281);
        // c
        xForm.setCoeff01(0);
        // d
        xForm.setCoeff11(1);
        // f
        xForm.setCoeff21(-1.22115911);
        xForm.setPostCoeff00(1);
        xForm.setPostCoeff10(0);
        xForm.setPostCoeff01(0);
        xForm.setPostCoeff11(1);
        xForm.setPostCoeff20(0);
        xForm.setPostCoeff21(0);
        // variation 1
        {
            double amount = Math.random() > 0.25 ? 1.0 - 2.0 * Math.random() : 1.0;
            xForm.addVariation(amount, getRandomVariation());
            if (Math.random() > 0.5) {
                new RandomParamMutation().setRandomFlameProperty(flame.getFirstLayer(), 1.0);
            }
        }
    }
    // create transform 2
    {
        XForm xForm = new XForm();
        layer.getXForms().add(xForm);
        xForm.setWeight(286.87636036);
        xForm.setColor(0.90312262);
        xForm.setColorSymmetry(0.95);
        // a
        xForm.setCoeff00(0.96333808);
        // b
        xForm.setCoeff10(0.12845865);
        // e
        xForm.setCoeff20(0.31387449);
        // c
        xForm.setCoeff01(-0.12845865);
        // d
        xForm.setCoeff11(0.96333808);
        // f
        xForm.setCoeff21(0.08003269);
        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("sec", true));
    }
    if (Math.random() > 0.5) {
        new LocalGammaMutation().execute(flame.getFirstLayer());
    }
    return flame;
}
Also used : RandomParamMutation(org.jwildfire.create.tina.mutagen.RandomParamMutation) XForm(org.jwildfire.create.tina.base.XForm) LocalGammaMutation(org.jwildfire.create.tina.mutagen.LocalGammaMutation) Layer(org.jwildfire.create.tina.base.Layer) Flame(org.jwildfire.create.tina.base.Flame)

Aggregations

Flame (org.jwildfire.create.tina.base.Flame)1 Layer (org.jwildfire.create.tina.base.Layer)1 XForm (org.jwildfire.create.tina.base.XForm)1 LocalGammaMutation (org.jwildfire.create.tina.mutagen.LocalGammaMutation)1 RandomParamMutation (org.jwildfire.create.tina.mutagen.RandomParamMutation)1