Search in sources :

Example 6 with GlobalScript

use of org.jwildfire.create.tina.animate.GlobalScript in project JWildfire by thargor6.

the class TransformingBubblesRandomMovieGenerator method prepareMovie.

@Override
protected FlameMovie prepareMovie(Prefs pPrefs) {
    FlameMovie movie = new FlameMovie(pPrefs);
    Flame flame = genRandomFlame(new BubblesRandomFlameGenerator(), pPrefs);
    FlameMoviePart part = new FlameMoviePart();
    part.setFlame(flame);
    part.setFrameCount(320);
    part.setFrameMorphCount(0);
    movie.addPart(part);
    {
        double amplitude = -1.25 * Math.random() * 2.5;
        movie.getGlobalScripts()[0] = new GlobalScript(GlobalScriptType.ROTATE_ROLL, amplitude);
    }
    {
        double amplitude = Math.random() * 2.0 + 0.2;
        movie.getGlobalScripts()[1] = new GlobalScript(GlobalScriptType.MOVE_CAM_X, amplitude);
    }
    if (Math.random() < 0.5) {
        double amplitude = Math.random() * 0.25;
        movie.getGlobalScripts()[2] = new GlobalScript(GlobalScriptType.MOVE_CAM_Z, amplitude);
    }
    {
        double amplitude = -0.5 * Math.random() * 1.0;
        movie.getxFormScripts()[0] = new XFormScript(XFormScriptType.ROTATE_FIRST_XFORM, amplitude);
    }
    return movie;
}
Also used : XFormScript(org.jwildfire.create.tina.animate.XFormScript) GlobalScript(org.jwildfire.create.tina.animate.GlobalScript) BubblesRandomFlameGenerator(org.jwildfire.create.tina.randomflame.BubblesRandomFlameGenerator) FlameMovie(org.jwildfire.create.tina.animate.FlameMovie) FlameMoviePart(org.jwildfire.create.tina.animate.FlameMoviePart) Flame(org.jwildfire.create.tina.base.Flame)

Example 7 with GlobalScript

use of org.jwildfire.create.tina.animate.GlobalScript in project JWildfire by thargor6.

the class TinaSWFAnimatorController method getGlobalScriptFromUI.

private GlobalScript getGlobalScriptFromUI(JComboBox pCmb, JWFNumberField pField) {
    GlobalScriptType scriptType = (GlobalScriptType) pCmb.getSelectedItem();
    GlobalScript res = new GlobalScript(scriptType != null ? scriptType : GlobalScriptType.NONE, pField.getDoubleValue());
    res.getAmplitudeCurve().assign(curves.get(pField.getMotionPropertyName()).getCurve());
    return res;
}
Also used : GlobalScript(org.jwildfire.create.tina.animate.GlobalScript) GlobalScriptType(org.jwildfire.create.tina.animate.GlobalScriptType)

Aggregations

GlobalScript (org.jwildfire.create.tina.animate.GlobalScript)7 XFormScript (org.jwildfire.create.tina.animate.XFormScript)4 Flame (org.jwildfire.create.tina.base.Flame)4 FlameMovie (org.jwildfire.create.tina.animate.FlameMovie)3 FlameMoviePart (org.jwildfire.create.tina.animate.FlameMoviePart)3 ArrayList (java.util.ArrayList)1 XMLAttributes (org.jwildfire.base.Tools.XMLAttributes)1 GlobalScriptType (org.jwildfire.create.tina.animate.GlobalScriptType)1 BubblesRandomFlameGenerator (org.jwildfire.create.tina.randomflame.BubblesRandomFlameGenerator)1 DuckiesRandomFlameGenerator (org.jwildfire.create.tina.randomflame.DuckiesRandomFlameGenerator)1 MandelbrotRandomFlameGenerator (org.jwildfire.create.tina.randomflame.MandelbrotRandomFlameGenerator)1 RenderedFlame (org.jwildfire.create.tina.render.RenderedFlame)1