I've been putting in a lot of effort to figure this out on my own, but I'm completely new to three.js and javascript, and I really need some assistance.
My goal is to import a model from threex into my three.js scene. However, when I try to add the code for it like this:
var spaceship = null;
THREEx.SpaceShips.loadSpaceFighter03(function(object3d){
scene.add(object3d)
spaceship = object3d
})
All I get is a blank scene and an error in my 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
This points me towards a line of code in MTLLoader.js that seems to be causing the issue.
params[ 'ambient' ] = new THREE.Color().fromArray( value );
I'm feeling a bit lost and overwhelmed. Can someone please help me troubleshoot this?
I am following this tutorial: https://www.youtube.com/watch?v=vw5_YyM4hn8 (I have also referenced the sample code here: https://github.com/jeromeetienne/flying-spaceship-minigame/blob/master/step1-01-naked-spaceship.html, but have not been able to resolve the issue.)
Thank you for any help you can provide.