This repo contains the source code for the "App3D" library, which is a custom wrapper library built on the open-source three.js library (link: https://github.com/mrdoob/three.js/). The App3D library can be included in frontend projects to build custom 3D applications.
Individual features of the App3D library can be seen / demonstrated in the unit test files included at /tutorials. Details on how to run these unit test demos are included below.
sudo apt-get install -y npm
sudo npm i rollup -g
cd <repo>
Then, you can either perform the build once:
rollup -c
...or perform the build automatically each time relevant code files change (better for during development):
rollup -c --watch
"Deploying" the App3D library consists of running additional cleanup / build tasks on the App3D source code, then copying it to the "App 3D Server" repository for all applications there to use. The App 3D Server is located here: https://sh_git.appropolis.com.cn/appropolis/front/App3dServer
sudo apt-get install -y npm
sudo npm i eslint -g
cd <repo>
eslint --fix .
This will automatically enforce a bare minimum of our coding standards on the source code (e.g.: adding semicolons, white spaces, indentation, etc.).
Step 3: Install babel, babel presets, and js-obfuscate plugins for rollup (if not installed already):
npm i -D rollup-plugin-babel@3
npm i -D babel-preset-env babel-plugin-external-helpers
npm i -D javascript-obfuscator
# in windows, use this command (npm install --save-dev rollup-plugin-javascript-obfuscator)
rollup -c rollupBabelAndUglify.config.js
Note that this more complicated rollup can take 30 seconds or more to complete.
Step 5: Copy the newly-built "app3d.js" file to /libs/app3d, replacing the file that's already there
cd tutorials/pythonServer
python3 cors_server.py [port]
If for whatever reason you only wish to perform the Babel transpilation (and not the Uglify), then instead of the above steps, run:
rollup -c rollupBabel.config.js
- /build/app3d.js : Output file
- /tutorials : Various tutorial files
- /src : Source code
- /thirdParty : Third party libraries
See the file coding-guidelines.txt
- [Added] Feature description
- [Updated] Feature description
- [Fixed] Bug description
- [Removed] Feature description
- filename extension description
".app1" = ".dae"
".app2" = ".glb"
".app3" = ".gltf"
".app4" = ".fbx"
".app5" = ".json"