11# objTo3d-tiles
2- Node command line tool convert obj model file to 3D Tiles, based on [ obj2gltf] ( https://github.com/AnalyticalGraphicsInc/obj2gltf ) .
2+ Node command line tool and module convert obj model file to 3D Tiles, based on [ obj2gltf] ( https://github.com/AnalyticalGraphicsInc/obj2gltf ) .
33
44[ Online Demonstration] ( https://princessgod.github.io/plc/batchedTileset.html )
55
@@ -10,37 +10,26 @@ Node command line tool convert obj model file to 3D Tiles, based on [obj2gltf](h
1010> Please use Cesium after v1.37, cause this 3d tile use glTF2.0.
1111
1212## Getting Start
13- Clone this repository to local.
14-
15- ```
16- git clone https://github.com/PrincessGod/objTo3d-tiles.git
17- ```
18-
19- Navigate in the repository folder.
20-
21- ```
22- cd objTo3d-tiles
23- ```
2413
2514Make sure you have [ Node] ( https://nodejs.org/en/ ) installed, and then
2615
2716```
28- npm install
17+ npm install -g obj23dtiles
2918```
3019
3120### Basic Usage
3221
3322* Convert ` .obj ` to ` .gltf `
3423
3524```
36- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj
25+ obj23dtiles -i ./bin/barrel/barrel.obj
3726// Export barrel.gltf at obj folder.
3827```
3928
4029* Convert ` .obj ` to ` .glb `
4130
4231```
43- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj -b
32+ obj23dtiles -i ./bin/barrel/barrel.obj -b
4433// Export barrel.glb at obj folder.
4534```
4635
@@ -57,35 +46,35 @@ node ./bin/obj23dtiles.js -i ./bin/barrel/barrel.obj -b
5746* Convert ` .obj ` to ` .b3dm ` with default [ BatchTable] ( https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/BatchTable/README.md ) , which have ` batchId ` and ` name ` property, and ` name ` is model's name.
5847
5948```
60- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj --b3dm
49+ obj23dtiles -i ./bin/barrel/barrel.obj --b3dm
6150// Export barrel.b3dm at obj folder.
6251```
6352
6453* Convert ` .obj ` to ` .b3dm ` with default [ BatchTable] ( https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/BatchTable/README.md ) and export default BatchTable (a JSON file). Maybe get information for custom BatchTable.
6554
6655```
67- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj --b3dm --outputBatchTable
56+ obj23dtiles -i ./bin/barrel/barrel.obj --b3dm --outputBatchTable
6857// Export barrel.b3dm and barrel_batchTable.json at obj folder.
6958```
7059
7160* Convert ` .obj ` to ` .b3dm ` with custom [ BatchTable] ( https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/BatchTable/README.md ) .
7261
7362```
74- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj -c ./bin/barrel/customBatchTbale .json --b3dm
63+ obj23dtiles -i ./bin/barrel/barrel.obj -c ./bin/barrel/customBatchTable .json --b3dm
7564// Export barrel.b3dm with custom batch table at obj folder.
7665```
7766
7867* Convert ` .obj ` to ` .i3dm ` width [ FeatureTable] ( https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Instanced3DModel/README.md#feature-table ) .
7968
8069```
81- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj -f ./bin/barrel/customFeatureTable.json --i3dm
70+ obj23dtiles -i ./bin/barrel/barrel.obj -f ./bin/barrel/customFeatureTable.json --i3dm
8271// Export barrel.i3dm at obj folder.
8372```
8473
8574* Convert ` .obj ` to ` .i3dm ` with [ FeatureTable] ( https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Instanced3DModel/README.md#feature-table ) and [ BatchTable] ( https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/TileFormats/Instanced3DModel/README.md#batch-table ) .
8675
8776```
88- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj -f ./bin/barrel/customFeatureTable.json
77+ obj23dtiles -i ./bin/barrel/barrel.obj -f ./bin/barrel/customFeatureTable.json
8978-c ./bin/barrel/customI3dmBatchTable.json --i3dm
9079// Export barrel.i3dm with BatchTable at obj folder.
9180```
@@ -97,30 +86,30 @@ FeatureTable support following parameters : `position`, `orientation`, `scale`.
9786* Create a single tileset with ` .b3dm ` tile.
9887
9988```
100- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj --tileset
89+ obj23dtiles -i ./bin/barrel/barrel.obj --tileset
10190// Export ./Batchedbarrel folder at obj folder which is a tileset.
10291```
10392
10493* Create a single tileset with ` .b3dm ` tile and custom tileset options, custom BatchTable.
10594
10695```
107- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj --tileset
108- -p ./bin/barrel/customTilesetOptions.json -c ./bin/barrel/customBatchTbale .json
96+ obj23dtiles -i ./bin/barrel/barrel.obj --tileset
97+ -p ./bin/barrel/customTilesetOptions.json -c ./bin/barrel/customBatchTable .json
10998// Export ./Batchedbarrel folder at obj folder which is a tileset with custom tileset options.
11099```
111100
112101* Create a single tileset with ` .i3dm ` tile.
113102
114103```
115- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj --tileset --i3dm
104+ obj23dtiles -i ./bin/barrel/barrel.obj --tileset --i3dm
116105-f ./bin/barrel/customFeatureTable.json
117106// Export ./Instancedbarrel folder at obj folder which is a tileset.
118107```
119108
120109* Create a single tileset with ` .i3dm ` tile and custom tileset options, custom BatchTable.
121110
122111```
123- node ./bin/ obj23dtiles.js -i ./bin/barrel/barrel.obj --tileset --i3dm
112+ obj23dtiles -i ./bin/barrel/barrel.obj --tileset --i3dm
124113-f ./bin/barrel/customFeatureTable.json -p ./bin/barrel/customTilesetOptions.json
125114-c ./bin/barrel/customI3dmBatchTable.json
126115// Export ./Instancedbarrel folder at obj folder which is a tileset.
@@ -148,7 +137,7 @@ Here are different bounding volumes.
148137You can combine tilesets into one ` tileset.json ` as external tileset.
149138
150139```
151- node ./bin/ obj23dtiles.js combine -i ./your/tilesets/folder/
140+ obj23dtiles combine -i ./bin/barrel/output
152141```
153142
154143## Using as node module
0 commit comments