Package com.ardor3d.extension.model.md2

Examples of com.ardor3d.extension.model.md2.Md2Importer


                    ".pcx"));
        } catch (final URISyntaxException ex) {
            ex.printStackTrace();
        }

        final Md2DataStore storage = importer.load("md2/drfreak.md2");
        System.out.println("Importing Took " + (System.currentTimeMillis() - time) + " ms");

        final Mesh model = storage.getScene();
        // md2 models are usually z-up - switch to y-up
        model.setRotation(new Quaternion().fromAngleAxis(-MathUtils.HALF_PI, Vector3.UNIT_X));
        // attack to root
        _root.attachChild(model);

        // speed us up a little
        final KeyframeController<Mesh> controller = storage.getController();
        controller.setSpeed(8);
        controller.setRepeatType(RepeatType.WRAP);
    }
View Full Code Here


        _canvas.setTitle("Ardor3D - Simple Md2 Example");
        _canvas.getCanvasRenderer().getCamera().setLocation(new Vector3(0, 5, 20));

        // Load the scene
        final long time = System.currentTimeMillis();
        final Md2Importer importer = new Md2Importer();
        try {
            importer.setTextureLocator(new MultiFormatResourceLocator(ResourceLocatorTool.getClassPathResource(
                    SimpleObjExample.class, "com/ardor3d/example/media/models/md2/"), ".dds", ".jpg", ".png", ".tga",
                    ".pcx"));
        } catch (final URISyntaxException ex) {
            ex.printStackTrace();
        }

        final Md2DataStore storage = importer.load("md2/drfreak.md2");
        System.out.println("Importing Took " + (System.currentTimeMillis() - time) + " ms");

        final Mesh model = storage.getScene();
        // md2 models are usually z-up - switch to y-up
        model.setRotation(new Quaternion().fromAngleAxis(-MathUtils.HALF_PI, Vector3.UNIT_X));
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.model.md2.Md2Importer

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.