mirror of
https://github.com/CesiumGS/obj2gltf.git
synced 2025-02-07 07:22:51 -05:00
This gets rid of the TypeScriptDefinitions directory and associated gulp task. Instead it uses the typings module which is a more standard way to manage TS definitions. This now creates a typings folder at npm install type and WebStorm has been configured to simply point to that. Not only is this cleaner, but the actual intellisense is much better at WebStorm should provide even more help now. Also removed the request dependency because it's no loner used. Also added missing entries to npmignore and gitignore. As part of this change, I also updated all npm modules to there latest version, this is in preparation for turning on greenkeeper.
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.
Description
Languages
JavaScript
100%