Go to file
2016-12-15 10:55:41 -05:00
.idea Upgrade gltf-pipeline 2016-12-12 10:13:44 -05:00
bin Added compress flag and updated version number 2016-08-25 13:48:34 -04:00
doc Updated readme 2015-10-18 23:51:01 -04:00
lib Fix wrong param name 2016-08-26 15:49:55 -04:00
specs Added compress flag and updated version number 2016-08-25 13:48:34 -04:00
.gitignore Use typings instead of rolling our own TypeScript definition solution 2016-10-25 20:23:27 -04:00
.jshintrc Updated project for publishing 2016-07-08 18:10:18 -04:00
.npmignore Use typings instead of rolling our own TypeScript definition solution 2016-10-25 20:23:27 -04:00
.travis.yml Updated project for publishing 2016-07-08 18:10:18 -04:00
CHANGES.md Update version for line-ending fix 2016-09-07 18:12:29 -04:00
gulpfile.js Use typings instead of rolling our own TypeScript definition solution 2016-10-25 20:23:27 -04:00
index.js Upgrade for gltf-pipeline 2016-06-10 17:43:30 -04:00
LICENSE.md Updated project for publishing 2016-07-08 18:10:18 -04:00
package.json Update gltf-pipeline 2016-12-13 14:13:40 -05:00
README.md Last few tweaks 2016-07-22 16:17:27 -04:00
typings.json Use typings instead of rolling our own TypeScript definition solution 2016-10-25 20:23:27 -04:00

OBJ2GLTF

Convert OBJ assets to glTF 1.0.

Getting Started

Install Node.js if you don't already have it, and then:

npm install --save obj2gltf

Using obj2gltf as a library:

var obj2gltf = require('obj2gltf');
var convert = obj2gltf.convert;
var options = {
    embedImage : false // Don't embed image in the converted glTF
}
convert('model.obj', 'model.gltf', options)
    .then(function() {
        console.log('Converted model');
    });

Using obj2gltf as a command-line tool:

node bin/obj2gltf.js model.obj

node bin/obj2gltf.js model.obj model.gltf

node bin/obj2gltf.js -i model.obj -o model.gltf

node bin/obj2gltf.js -i model.obj -o model.gltf -s

Usage

###Command line flags:

Flag Description Required
-i Path to the input OBJ file. Yes
-o Directory or filename for the exported glTF file. No
-b Output binary glTF. No, default false
-s Writes out separate geometry/animation data files, shader files, and textures instead of embedding them in the glTF file. No, default false
-t Write out separate textures only. No, default false
--ao Apply ambient occlusion to the converted model. No, default false
-h Display help No

Contributions

Pull requests are appreciated. Please use the same Contributor License Agreement (CLA) used for Cesium.


Developed by the Cesium team.