Search in sources :

Example 1 with DuckiesRandomFlameGenerator

use of org.jwildfire.create.tina.randomflame.DuckiesRandomFlameGenerator in project JWildfire by thargor6.

the class TransformingDuckiesRandomMovieGenerator method prepareMovie.

@Override
protected FlameMovie prepareMovie(Prefs pPrefs) {
    FlameMovie movie = new FlameMovie(pPrefs);
    Flame flame = genRandomFlame(new DuckiesRandomFlameGenerator(), 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_2ND_XFORM, amplitude);
    }
    return movie;
}
Also used : XFormScript(org.jwildfire.create.tina.animate.XFormScript) GlobalScript(org.jwildfire.create.tina.animate.GlobalScript) FlameMovie(org.jwildfire.create.tina.animate.FlameMovie) DuckiesRandomFlameGenerator(org.jwildfire.create.tina.randomflame.DuckiesRandomFlameGenerator) FlameMoviePart(org.jwildfire.create.tina.animate.FlameMoviePart) Flame(org.jwildfire.create.tina.base.Flame)

Aggregations

FlameMovie (org.jwildfire.create.tina.animate.FlameMovie)1 FlameMoviePart (org.jwildfire.create.tina.animate.FlameMoviePart)1 GlobalScript (org.jwildfire.create.tina.animate.GlobalScript)1 XFormScript (org.jwildfire.create.tina.animate.XFormScript)1 Flame (org.jwildfire.create.tina.base.Flame)1 DuckiesRandomFlameGenerator (org.jwildfire.create.tina.randomflame.DuckiesRandomFlameGenerator)1