Package com.ardor3d.extension.model.collada.jdom

Examples of com.ardor3d.extension.model.collada.jdom.ColladaImporter$ArdorFactory


    public void addStaticModel(String name, Vector3 position, double scale, Quaternion rotation) {
        if (rotation == null)
            rotation = new Quaternion(-1,0,0,1);
        try {
            final ColladaStorage storage = new ColladaImporter().load(name);
            Node colladaNode = storage.getScene();
            colladaNode.setRotation(rotation);
            colladaNode.setTranslation(position);
            colladaNode.setScale(scale);
            staticObjectNode.attachChild(colladaNode);
View Full Code Here


   


    private void loadColladaModel( final ResourceSource source) {
        try {
            final ColladaImporter colladaImporter = new ColladaImporter();

            // Load the collada scene
            final ColladaStorage storage = colladaImporter.load(source);
            colladaNode = storage.getScene();
            colladaNode.setRotation(new Quaternion(-1,0,0,1));
        } catch (final Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here

        try {
            skNode.detachAllChildren();
            _root.attachChild(skNode);

            final long time = System.currentTimeMillis();
            final ColladaImporter colladaImporter = new ColladaImporter();

            // OPTIMIZATION: run GeometryTool on collada meshes to reduce redundant vertices...
            colladaImporter.setOptimizeMeshes(true);

            // Load the collada scene
            final String mainFile = "collada/skeleton/skeleton.walk.dae";
            final ColladaStorage storage = colladaImporter.load(mainFile);
            final Node colladaNode = storage.getScene();
            final List<SkinData> skinDatas = storage.getSkins();
            pose = skinDatas.get(0).getPose();

            createAnimation();
View Full Code Here

            ex.printStackTrace();
        }
    }

    private void createAnimation() {
        final ColladaImporter colladaImporter = new ColladaImporter();

        // Make our manager
        manager = new AnimationManager(_timer, pose);

        // Add our "applier logic".
        final SimpleAnimationApplier applier = new SimpleAnimationApplier();
        manager.setApplier(applier);

        // Add a call back to load clips.
        final InputStore input = new InputStore();
        input.getClips().setMissCallback(new MissingCallback<String, AnimationClip>() {
            public AnimationClip getValue(final String key) {
                try {
                    final ColladaStorage storage1 = colladaImporter.load("collada/skeleton/" + key + ".dae");
                    return storage1.extractChannelsAsClip(key);
                } catch (final IOException e) {
                    e.printStackTrace();
                }
                return null;
View Full Code Here

        try {
            skNode.detachAllChildren();
            _root.attachChild(skNode);

            final long time = System.currentTimeMillis();
            final ColladaImporter colladaImporter = new ColladaImporter();

            // OPTIMIZATION: run GeometryTool on collada meshes to reduce redundant vertices...
            colladaImporter.setOptimizeMeshes(true);

            // Load the collada scene
            final String mainFile = "collada/skeleton/skeleton.walk.dae";
            final ColladaStorage storage = colladaImporter.load(mainFile);
            final Node colladaNode = storage.getScene();
            final List<SkinData> skinDatas = storage.getSkins();
            pose = skinDatas.get(0).getPose();

            createAnimation();
View Full Code Here

            ex.printStackTrace();
        }
    }

    private void createAnimation() {
        final ColladaImporter colladaImporter = new ColladaImporter();

        // Make our manager
        manager = new AnimationManager(_timer, pose);

        // Add our "applier logic".
        final SimpleAnimationApplier applier = new SimpleAnimationApplier();
        manager.setApplier(applier);

        // Add a call back to load clips.
        final InputStore input = new InputStore();
        input.getClips().setMissCallback(new MissingCallback<String, AnimationClip>() {
            public AnimationClip getValue(final String key) {
                try {
                    final ColladaStorage storage1 = colladaImporter.load("collada/skeleton/" + key + ".dae");
                    return storage1.extractChannelsAsClip(key);
                } catch (final IOException e) {
                    e.printStackTrace();
                }
                return null;
View Full Code Here

                AnimationBlinnPhongExample.class,
                "com/ardor3d/example/media/models/collada/juanita/dog_Apr18_specular.dds"));
        final Texture specular = TextureManager.load(specularRS,
                Texture.MinificationFilter.NearestNeighborNearestMipMap, false);

        colladaImporter = new ColladaImporter();

        final ResourceSource rs = ResourceLocatorTool.locateResource(ResourceLocatorTool.TYPE_MODEL,
                "com/ardor3d/example/media/models/collada/juanita/dog_Apr18_smooth.dae");
        try {
            colladaStorage = colladaImporter.load(rs);
View Full Code Here

    private SkinnedMesh loadMainSkeleton() {
        SkinnedMesh skeleton = null;
        try {
            final long time = System.currentTimeMillis();
            final ColladaImporter colladaImporter = new ColladaImporter();

            // OPTIMIZATION: run GeometryTool on collada meshes to reduce redundant vertices...
            colladaImporter.setOptimizeMeshes(true);

            // Load the collada scene
            final String mainFile = "collada/skeleton/skeleton.walk.dae";
            final ColladaStorage storage = colladaImporter.load(mainFile);
            final Node colladaNode = storage.getScene();

            System.out.println("Importing: " + mainFile);
            System.out.println("Took " + (System.currentTimeMillis() - time) + " ms");
View Full Code Here

        final InputStore input = new InputStore();
        input.getClips().setMissCallback(new MissingCallback<String, AnimationClip>() {
            public AnimationClip getValue(final String key) {
                if (!animationStore.containsKey(key)) {
                    try {
                        final ColladaStorage storage1 = new ColladaImporter().load("collada/skeleton/" + key + ".dae");
                        animationStore.put(key, storage1.extractChannelsAsClip(key));
                    } catch (final IOException e) {
                        e.printStackTrace();
                        animationStore.put(key, null);
                    }
View Full Code Here

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

        // Load the collada scene
        try {
            final ColladaStorage storage = new ColladaImporter().load("collada/sony/Seymour.dae");
            _root.attachChild(storage.getScene());
        } catch (final IOException ex) {
            ex.printStackTrace();
        }
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.model.collada.jdom.ColladaImporter$ArdorFactory

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.