Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to build three.js from sources

I'm having some trouble getting three.js to build - the resulting three.js file is significantly different than what I downloaded.

This is likely related to the comment "This page is currently invalid and needs to be rewritten" on this page in the wiki, ["How to generate a compressed Three"](https://github.com/mrdoob/three.js/wiki/build.py, -or-how-to-generate-a-compressed-Three.js-file).

Nonetheless, I'm a bit up a tree.

I'd like to add collision exclusion to Raycaster.js/intersectObject(), but rebuilding breaks my app without errors or warnings in the console.

I've tried with various permutations of the possible --include's, with varying but unsuccessful results.

I'm not even trying to build the minified version.

I'm on OSX.

Any pointers are appreciated.

like image 269
orion elenzil Avatar asked Mar 23 '23 17:03

orion elenzil


1 Answers

On a terminal window go to utils/build and run:

python build.py --include common --include extras --output ../../build/three.js

Or... run the shell file:

./build.sh
like image 70
mrdoob Avatar answered Apr 26 '23 06:04

mrdoob