javascript - Three.js - Importing an .obj model with ObjLoader.js -



javascript - Three.js - Importing an .obj model with ObjLoader.js -

i've been trying load .obj model 'three' using objloader.js, i'm not seeing model , i'm getting 2 pairs of errors saying:

uncaught typeerror: object [object object] has no method 'dispatchevent'

...twice line 24 , other pair line 32 in objloader.js:

line 24: scope.dispatchevent( { type: 'load', content: hierarchy } );

line 32: scope.dispatchevent( { type: 'progress', loaded: event.loaded, total: event.total } );

here's code i'm using load model:

var manager = new three.loadingmanager(); manager.onprogress = function ( item, loaded, total ) { console.log( item, loaded, total ); }; var loader = new three.objloader( manager ); loader.load( 'models/shipfighter.obj', function ( object ) { var shiptexture = new three.meshlambertmaterial({ color: 0xff0000 }); object.traverse( function ( kid ) { if ( kid instanceof three.mesh ) { child.material.map = shiptexture; child.material.needsupdate = true; } } ); object.position.y = 20; scene.add( object ) } );

any ideas i'm doing wrong? cheers.

javascript three.js .obj

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -