This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //following two rotation functions are updated versions of code from: https://github.com/mrdoob/three.js/issues/1219 | |
| //updated to work in latest versions (r52 tested) of THREE.js | |
| // Rotate an object around an axis in object space | |
| var rotationMatrix | |
| function rotateAroundObjectAxis( object, axis, radians ) { | |
| rotationMatrix = new THREE.Matrix4(); | |
| rotationMatrix.makeRotationAxis( axis.normalize(), radians ); | |
| object.matrix.multiplySelf( rotationMatrix ); // post-multiply | |
| object.rotation.setEulerFromRotationMatrix(object.matrix, object.order); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var p1 = { | |
| x: 20, | |
| y: 20 | |
| }; | |
| var p2 = { | |
| x: 40, | |
| y: 40 | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * This work is free. You can redistribute it and/or modify it under the | |
| * terms of the Do What The Fuck You Want To Public License, Version 2, | |
| * as published by Sam Hocevar. See the COPYING file for more details. | |
| */ | |
| /* | |
| * Easing Functions - inspired from http://gizma.com/easing/ | |
| * only considering the t value for the range [0, 1] => [0, 1] | |
| */ | |
| EasingFunctions = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** round n down to nearest multiple of m */ | |
| long roundDown(long n, long m) { | |
| return n >= 0 ? (n / m) * m : ((n - m + 1) / m) * m; | |
| } | |
| /** round n up to nearest multiple of m */ | |
| long roundUp(long n, long m) { | |
| return n >= 0 ? ((n + m - 1) / m) * m : (n / m) * m; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
NewerOlder