Package com.jme.scene.geometryinstancing

Examples of com.jme.scene.geometryinstancing.GeometryBatchInstance


        for (int x = 0; x < size; x++) {
            for (int z = 0; z < size; z++) {
                orand = rand.nextFloat() - .5f;
                for (int i = 0; i < turnNumber; i++) {
                    frand = (rand.nextFloat() * 0.50f) + 0.50f;
                    GeometryBatchInstance instance = new GeometryBatchInstance(q, new GeometryBatchInstanceAttributes(instanceTranslation.set((x * VegetationManager.VEGETATION_STEP) + orand, scale / 2, (z * VegetationManager.VEGETATION_STEP) + orand), new Vector3f(scale * frand, scale * frand, scale * frand), new Quaternion().fromAngleAxis((float) ((Math.PI * 2) / turnNumber) * i, Vector3f.UNIT_Y), new ColorRGBA(INSTANCE_COLOR.r + (rand.nextFloat() / 10f), INSTANCE_COLOR.g + (rand.nextFloat() / 8f), INSTANCE_COLOR.b + (rand.nextFloat() / 8f), INSTANCE_COLOR.a)));

                    creator.addInstance(instance);
                }
            }
        }
View Full Code Here

TOP

Related Classes of com.jme.scene.geometryinstancing.GeometryBatchInstance

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.