Package toxi.volume

Examples of toxi.volume.VolumetricSpaceArray


    public void setup() {
        size(100, 100);
        // size(1024, 768, OPENGL);
        // hint(ENABLE_OPENGL_4X_SMOOTH);
        strokeWeight(0.5f);
        VolumetricSpace volume = new VolumetricSpaceArray(SCALE, DIMX, DIMY,
                DIMZ);
        // fill volume with noise
        for (int z = 0, index = 0; z < DIMZ; z++) {
            println(z);
            for (int y = 0; y < DIMY; y++) {
                for (int x = 0; x < DIMX; x++) {
                    volume.setVoxelAt(
                            x,
                            y,
                            z,
                            (float) SimplexNoise.noise(x * NS, y * NS, z * NS) * 0.5f);
                }
            }
        }
        println("noise done");
        volume.closeSides();
        long t0 = System.nanoTime();
        // store in IsoSurface and compute surface mesh for the given threshold
        // value
        mesh = new TriangleMesh("iso", 4000000, 12000000);
        surface = new HashIsoSurface(volume, 0.33f);
View Full Code Here

TOP

Related Classes of toxi.volume.VolumetricSpaceArray

Copyright © 2018 www.massapicom. 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.