A command line tool to convert gltf(glb) file to 3d tiles format.
GLTF_OPTIMIZER.exe -i "../data/test.gltf" -o "../data/output"
Here is the source gltf model and the generated result. https://pan.baidu.com/s/10VI1h9dORIFFDF8CVSRdnQ code: pw6l
git clone -b devel https://github.com/cnr-isti-vclab/vcglib.git
Set environment VCG_LIB to root of vcglib.
git clone https://github.com/nxddsnc/GLTF-Optimizer.git
Build it with vs2015 community.
There are serveral step for the conversion.
Step1. Import gltf file use tinygltf.
Step2. Create hierachical binary tree and insert nodes to boxes according to it's bounding box center.
Step3. Generate tileset structure according to the result of step2.
Step4. Do decimation on each level of the tree with the powerful mesh processing library vcglib.
Step5. Output the tileset.json file and corresponding gltf/glb(contains batchId) files.
After conversion, we can use 3dtiles-tools to convert glb to b3dm so that it can be viewed in cesium.js. Or use the command called "glbsToB3dms" in my fork (https://github.com/nxddsnc/3d-tiles-tools).