cedricpinson / osgjs

Javascript Implementation of OpenSceneGraph [DISCONTINUED] Website archived https://cedricpinson.github.io/osgjs-website/
MIT License
786 stars 202 forks source link

The problem for loading zip #1012

Open DengCun opened 5 years ago

DengCun commented 5 years ago

I can not load zip file by using under code.

var modelURL = 'character.zip'; var request = osgDB.readNodeURL(modelURL);

request
    .then(function(model) {
        var mt = new osg.MatrixTransform();
        osg.mat4.rotateZ(mt.getMatrix(), mt.getMatrix(), -Math.PI);

        mt.addChild(model);

        rootNode.addChild(mt);
        viewer.getManipulator().computeHomePosition();

        var loading = document.getElementById('loading');
        document.body.removeChild(loading);
    })
    .catch(function() {
        osg.warn('cant load ' + modelURL);
    });