Simple web service to convert 3D models from COLLADA to glTF using COLLADA2GLTF.
This is a code sample that is a starting point for a Node.js web service that converts COLLADA models to glTF. This version just converts a .dae file to a .gltf with embedded geometry, animations, skins, and shaders. It does not handle textures.
Clone this repo. Install Node.js. From this repo's root directory, run:
npm install
Start the server:
npm start
Invoke the web service by issuing an HTTP request and providing the COLLADA model with POST:
curl -X POST -H "Content-Type:text/plain" -d @test/data/box.dae localhost:3000/convert
A few settings can be changed by modifying config.json. This is loaded using nconf so environment variables and command-line arguments can override this.
To automatically restart the server during development, install and run nodemon:
npm install nodemon -g
nodemon server.js
Install and run JSHint:
npm install jshint -g
npm run jshint
Install mocha and run the tests:
npm install mocha -g
npm test
Build are in the collada2gltf directory. They are currently version 0.8 from here.
- 9 uses for cURL worth knowing
- nodeinpractice - book and sample code
Developed by AGI, founders of the Cesium WebGL engine.