问题
Example projects don't load 3d models to the scene. Or load but don't display, idk.
I tried both - the examples from three.js archive that I downloaded, also my own projects with my own models.
So I simply open three.js-master folder, open the index page in the examples folder, go through the list of examples. All examples work except the loaders examples. I just go through all of them and not a single format works, not obj, not fbx. What's wrong with local stuff? Online examples work but if I copy code from there it doesn't work.
See example
THE QUESTION
Maybe someone has a locally working example? Can someone just open that freaking three.js master folder on your desktop and run any example locally? I mean an example with a mesh loader. I'm already exhausted trying to make it work for a week...
回答1:
You have to run through a local webserver or change your browsers local file security policy.
It is all outlined at the three.js wiki at... Three.js, how to run things locally.
来源:https://stackoverflow.com/questions/43091935/three-js-project-loaders-dont-load-local-models-with-screenshot