obj2gltf/README.md

48 lines
1.5 KiB
Markdown
Raw Normal View History

2015-10-14 17:21:45 -04:00
# OBJ2GLTF
2015-10-18 23:33:54 -04:00
2015-10-20 09:44:21 -04:00
Convert OBJ assets to [glTF](https://www.khronos.org/gltf) 1.0.
2015-10-18 23:33:54 -04:00
## Getting Started
Install [Node.js](https://nodejs.org/en/) if you don't already have it, clone this repo, and then:
```
cd OBJ2GLTF
npm install
```
2015-10-20 09:34:25 -04:00
Run `node bin/obj2gltf.js` and pass it the path to an OBJ file.
2015-10-18 23:33:54 -04:00
2015-10-19 17:38:55 -04:00
## Usage
###Command line flags:
|Flag|Description|Required|
|----|-----------|--------|
|`-i`|Path to the input OBJ file.| :white_check_mark: Yes|
|`-o`|Directory or filename for the exported glTF file.|No|
|`-c`|Combine glTF resources, including images, into the exported glTF file.|No, default `false`|
2015-10-20 09:44:21 -04:00
|`-t`|Shading technique. Possible values are `lambert`, `phong`, `blinn`, and `constant`. The shading technique is typically determined by the MTL file, but this allows more explicit control.|No|
2015-10-19 17:38:55 -04:00
|`-h`|Display help|No|
###Examples:
2015-10-20 09:35:40 -04:00
`node bin/obj2gltf.js model.obj`
2015-10-19 17:38:55 -04:00
2015-10-20 09:35:40 -04:00
`node bin/obj2gltf.js model.obj model.gltf`
2015-10-19 17:38:55 -04:00
2015-10-20 09:35:40 -04:00
`node bin/obj2gltf.js -i model.obj -o model.gltf`
2015-10-19 17:38:55 -04:00
2015-10-20 09:35:40 -04:00
`node bin/obj2gltf.js -i model.obj -o model.gltf -c -t phong`
2015-10-19 17:38:55 -04:00
2015-10-18 23:33:54 -04:00
## Limitations
2015-10-19 17:38:55 -04:00
This tool is still in development. We plan on adding additional features like gzip compression, binary glTF export, and a testing suite.
2015-10-18 23:33:54 -04:00
Pull requests are appreciated. Please use the same [Contributor License Agreement (CLA)](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md) used for [Cesium](http://cesiumjs.org/).
---
Developed by the Cesium team.
<p align="center">
<a href="http://cesiumjs.org/"><img src="doc/cesium.png" /></a>
</p>