Search in sources :

Example 1 with MandelbrotRandomFlameGenerator

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

the class RotatingMandelbrotRandomMovieGenerator method prepareMovie.

@Override
protected FlameMovie prepareMovie(Prefs pPrefs) {
    FlameMovie movie = new FlameMovie(pPrefs);
    Flame flame = genRandomFlame(new MandelbrotRandomFlameGenerator(), pPrefs);
    flame.setCamPerspective(0.1 + 0.2 * Math.random());
    if (Math.random() < 0.5) {
        flame.setCamDOF(0.05 + 0.1 * Math.random());
    }
    FlameMoviePart part = new FlameMoviePart();
    part.setFlame(flame);
    part.setFrameCount(320);
    part.setFrameMorphCount(0);
    movie.addPart(part);
    {
        double amplitude = -0.75 * Math.random() * 1.5;
        movie.getGlobalScripts()[0] = (new GlobalScript(GlobalScriptType.ROTATE_YAW, amplitude));
    }
    {
        double amplitude = -0.25 * Math.random() * 0.5;
        movie.getGlobalScripts()[1] = new GlobalScript(GlobalScriptType.ROTATE_ROLL, amplitude);
    }
    {
        double amplitude = -0.125 * Math.random() * 0.25;
        movie.getGlobalScripts()[2] = new GlobalScript(GlobalScriptType.ROTATE_PITCH, amplitude);
    }
    {
        double amplitude = 0.2 + Math.random() * 0.6;
        movie.getGlobalScripts()[2] = new GlobalScript(GlobalScriptType.MOVE_CAM_Z, amplitude);
    }
    {
        double amplitude = 0.2 + Math.random() * 1.4;
        movie.getGlobalScripts()[2] = new GlobalScript(GlobalScriptType.MOVE_CAM_Y, amplitude);
    }
    return movie;
}
Also used : GlobalScript(org.jwildfire.create.tina.animate.GlobalScript) FlameMovie(org.jwildfire.create.tina.animate.FlameMovie) FlameMoviePart(org.jwildfire.create.tina.animate.FlameMoviePart) Flame(org.jwildfire.create.tina.base.Flame) MandelbrotRandomFlameGenerator(org.jwildfire.create.tina.randomflame.MandelbrotRandomFlameGenerator)

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 Flame (org.jwildfire.create.tina.base.Flame)1 MandelbrotRandomFlameGenerator (org.jwildfire.create.tina.randomflame.MandelbrotRandomFlameGenerator)1