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

Examples of com.ardor3d.extension.model.collada.jdom.data.ColladaStorage


    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);
        } catch (final IOException ex) {
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

            // 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();

            System.out.println("Importing: " + mainFile);
View Full Code Here

        // 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

            // 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");

            final GLSLShaderObjectsState gpuShader = new GLSLShaderObjectsState();
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

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

            // Load the collada scene
            final ColladaStorage storage = colladaImporter.load(source);
            colladaNode = storage.getScene();

            setupSkins(storage);
            setupAnimations(storage);

            System.out.println("Importing: " + source);
            System.out.println("Took " + (System.currentTimeMillis() - time) + " ms");

            // Add colladaNode to root
            _root.attachChild(colladaNode);

            // Setup camera
            ReadOnlyVector3 upAxis = Vector3.UNIT_Y;
            if (storage.getAssetData().getUpAxis() != null) {
                upAxis = storage.getAssetData().getUpAxis();
            }

            positionCamera(upAxis);
        } catch (final Exception ex) {
            ex.printStackTrace();
View Full Code Here

        }));
    }

    private void addRover() {
        try {
            final ColladaStorage storage = new ColladaImporter().load("collada/sketchup/NASA Mars Rover.dae");
            final Node rover = storage.getScene();
            rover.setTranslation(440, 102, 160.1);
            rover.setScale(3);
            rover.setRotation(new Quaternion().fromAngleAxis(-MathUtils.HALF_PI, Vector3.UNIT_X));
            _root.attachChild(rover);
        } catch (final IOException ex) {
View Full Code Here

            // 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();

            System.out.println("Importing: " + mainFile);
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.model.collada.jdom.data.ColladaStorage

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.