How to get started with yeoman and three.js?-Collection of common programming errors
I installed threejs with bower install threejs
Then after this I wish to have threejs in my page, so my app.js file starts with:
define(["jquery", "three"], function() {
"use strict";
However when my page loads the Chrome console shows
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/scripts/three.js
Uncaught Error: Script error
Well, shouldn’t it be looking in components like it does for JQuery?
Basically how can I get started with yeoman and installing three.js?
-
Solution is as follows.
The app.js file needs to refer to “three” as above and this refers to the file main.js which has the following.
require.config({ paths: { jquery: '../components/jquery/jquery', three: '../components/threejs/build/three' }, shim: { bootstrap: { deps: ['jquery'], exports: 'jquery' } } });
The key here is the three which points where threejs three.js file is located.