matrix.fromArray is not a function

Hi,

I’m trying to import a simple cube from C4D to three.js and get the following error:
TypeError: matrix.fromArray is not a function
at GLTFLoader.js:3003

Ok, next step was to double check the model itself and tried to import some other “proved” models.

Example files in the gltf format 2.0, for example the Duck.gltf, doesn’t work either.
(https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Duck/glTF)

I use the latest versions of node.js and the GLTFloader.js

Any ideas?

Thanks!

Notice that the usage of three.js (especially its loaders and exporters) in a node environment is restricted. Can you please share your code as a github repository so it’s possible to reproduce the issue on a local machine?

Uploaded it to the following repo:

I use the internal Webstorm server btw.

turntable_gltf.html actually contains a lot of legacy three.js code. I’ve cleaned up all deprecated stuff so no warnings and errors are logged anymore.

Besides, your glTF asset Duck.gltf was incomplete. The corresponding binary data Duck0.bin and the texture DuckCM.png were missing.

gltf-master.zip (717.3 KB)

Ah, thanks! I think there are to many old tutorials and legacy code out there…

Reminder to me: next time: RTFM first :wink:

1 Like

Hint: The official examples always use the latest version of three.js:

https://threejs.org/examples/

2 Likes