Package com.ardor3d.extension.atlas

Examples of com.ardor3d.extension.atlas.TexturePacker


            }
        };
        spatial.acceptVisitor(visitor, false);

        // Create an atlas packer with maximum atlas size of 256x256
        final TexturePacker packer = new TexturePacker(256, 256);

        // Add meshes into atlas (lots of different ways of doing this if you have other source/target
        // texture index)
        for (final Mesh mesh : meshes) {
            packer.insert(mesh);
        }

        // Create all the atlases (also possible to set filters here)
        packer.createAtlases();

        // XXX: This is only to write down the atlases to disk for debugging and viewing pleasure
        debugDumpAtlases(packer);
    }
View Full Code Here


        packIntoAtlas(meshes, 1);
    }

    private void packIntoAtlas(final List<Mesh> meshes, final int textureIndex) {
        // Create an atlas packer with maximum atlas size of 256x256
        final TexturePacker packer = new TexturePacker(256, 256);

        // Add meshes into atlas (lots of different ways of doing this if you have other source/target
        // texture index)
        for (final Mesh mesh : meshes) {
            packer.insert(mesh, textureIndex, textureIndex); // make the index for the atlases the same as the source
            // textures for this case
        }

        // Create all the atlases (also possible to set filters here)
        packer.createAtlases();

        // XXX: This is only to write down the atlases to disk for debugging and viewing pleasure
        debugDumpAtlases(packer);
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.atlas.TexturePacker

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.