Package org.matheusdev.demo

Source Code of org.matheusdev.demo.SimplexNoise3GifGenerator

package org.matheusdev.demo;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Random;

import javax.imageio.stream.FileImageOutputStream;
import javax.imageio.stream.ImageOutputStream;

import org.matheusdev.interpolation.FloatInterpolation;
import org.matheusdev.interpolation.FloatInterpolationFunc;
import org.matheusdev.noises.noise3.SimplexNoise3;
import org.matheusdev.util.GifSequenceWriter;
import org.matheusdev.util.matrix.matrix3.MatrixN3f;

/**
* @author matheusdev
*
*/
public final class SimplexNoise3GifGenerator {

  private SimplexNoise3GifGenerator() {}

  public static void main(String[] args) {
    final int width = 512;
    final int height = 512;
    final int depth = 64;

    final Random rand = new Random();
    final FloatInterpolation interp = new FloatInterpolationFunc() {
      @Override
      protected float func(float t) {
        float t2 = t*t;
        return 3 * t2 - 2 * t2 * t;
      }
    };

    SimplexNoise3 noise = new SimplexNoise3(width, height, depth, 5, rand, interp);

        Noise3GifGenerator.gen(noise, width, height, depth);
  }

}
TOP

Related Classes of org.matheusdev.demo.SimplexNoise3GifGenerator

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.