You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loading OBJ files in IE (in my case IE 11) causes a state exception in the Ajax request object. This occurs when, the xhr is set to "arraybuffer". This is a known problem in IE. The work around is to not set xhr to "arraybuffer", but keep its default as "text". Download the file as a string, and then convert it to an arraybuffer before passing it to ok()
Here is the full load() function with comments at the changes.
function load(url, ok, error) {
var xhr = new XMLHttpRequest();
//xhr.responseType = "arraybuffer"; // *** CHNAGED
Description of the problem
Loading OBJ files in IE (in my case IE 11) causes a state exception in the Ajax request object. This occurs when, the xhr is set to "arraybuffer". This is a known problem in IE. The work around is to not set xhr to "arraybuffer", but keep its default as "text". Download the file as a string, and then convert it to an arraybuffer before passing it to ok()
Here is the full load() function with comments at the changes.
// xhr.addEventListener('progress',
// function (event) {
// // TODO: Update the task? { type:'progress', loaded:event.loaded, total:event.total }
// }, false);
xhr.addEventListener('load',
function(event) {
if (event.target.response) {
var s = event.target.response; // *** CHANGEs HERE!!!
var uintArray = new Uint8Array(s.split('').map(function(char) {return char.charCodeAt(0);}));
ok(uintArray);
} else {
error('Invalid file [' + url + ']');
}
}, false);
xhr.addEventListener('error',
function() {
error('Couldn't load URL [' + url + ']');
}, false);
xhr.open('GET', url, true);
xhr.send(null);
}
})();
SceneJS version
Browser
OS
Hardware Requirements
The text was updated successfully, but these errors were encountered: