I've really tried my best to solve this with my own research, but unfortunately I'm an absolute novice with three.js and javascript and I really need some help.
I am trying to import a model from threex (google threex -- I can't post another link) into my three.js scene. Unfortunately, when I add the code to do so as follows:
var spaceship = null;
THREEx.SpaceShips.loadSpaceFighter03(function(object3d){
scene.add(object3d)
spaceship = object3d
})
I end up with a blank scene, and this error in my javascript console:
Uncaught TypeError: (intermediate value).fromArray is not a function.:8000/bower_components/threex.spaceships/examples/vendor/three.js/examples/js/loaders/MTLLoader.js:299
Which leads me to the (supposedly) offending line of code in MTLLoader.js (whatever that file is.)
params[ 'ambient' ] = new THREE.Color().fromArray( value );
I don't know what's happening, and I'm in a bit over my head I think. Does anybody know how to fix this?
I am working off of this tutorial: https://www.youtube.com/watch?v=vw5_YyM4hn8 (if it helps, the sample code for that segment of the tutorial is found here: https://github.com/jeromeetienne/flying-spaceship-minigame/blob/master/step1-01-naked-spaceship.html -- I can't see any problems -- I've so far tried to follow the steps very closely.)
Thanks in advance.