<body></body> <script src="http://gamingJS.com/Three.js"></script> <script src="http://gamingJS.com/ChromeFixes.js"></script> <script> // Code goes here... </script>I rather like short URLs like
http://gamingJS.com/Three.js. They ought to look like "normal" URLs to kids. They also do not introduce the additional concept of versioning libraries. Of course, that begs the question of how I will version libraries in the future.
I am not going to decide about versioning libraries tonight, but I am going to explore one possibility—versioning by Three.js version. The hope is to not only explore possible solutions, but also to see if my current code works with newer Three.js and Physijs.
➜ src unzip ~/Downloads/mrdoob-three.js-r52-0-gdaf110f.zip ➜ src cd mrdoob-three.js-daf110f ➜ mrdoob-three.js-daf110f cp src/Three.js ~/repos/gamingjs/52 ➜ mrdoob-three.js-daf110f cp ./examples/js/Detector.js ~/repos/gamingjs/52I do the same for Physijs:
➜ src tar xzf ~/Downloads/chandlerprall-Physijs-40a0489.tar.gz ➜ src cd chandlerprall-Physijs-40a0489/ ➜ chandlerprall-Physijs-40a0489 cp physi*.js ~/repos/gamingjs/52 ➜ chandlerprall-Physijs-40a0489 cp examples/js/ammo.js ~/repos/gamingjs/52Even though I do not believe that it will change between releases, I will add the ChromeFixes.js source file into 52 as well
➜ 52 git:(gh-pages) ✗ cp ../ChromeFixes.js .It is more of a code-editor fix than related to 3D programming, but it might look weird to the uninitiated to have some URLs include the 52 and some not.
➜ 52 git:(gh-pages) ✗ ls ammo.js ChromeFixes.js Detector.js physi.js physijs_worker.js Three.js Tween.jsI start editing this on my local machine. Hopefully I can get the the multi-sided, spinning thingy to work with the newer libraries:
But, after simply changing URLs to point to the new "52" libraries:
<body></body> <script src="http://localhost:4000/52/Three.js"></script> <script src="http://localhost:4000/52/ChromeFixes.js"></script> <script> // Code goes here... </script>It does not work.
Uncaught TypeError: undefined is not a functionThat correspond to the line that defines
THREE.Scene. Has Three.js change that much?
It turns out that, no, it has not changed that much. I had merely copied the Three.js src from the wrong place. I need to grab the assembled Three.js from the
buildsub-directory instead of pulling in just the top-level Three.js that clearly does not even have scenes:
➜ mrdoob-three.js-daf110f cp build/three.js ~/repos/gamingjs/52/Three.jsWith the correct Three.js in place, I again have a spiny, multi-sided thingy: