geopipe / gltf2glb Goto Github PK
View Code? Open in Web Editor NEWGLTF to Binary GLTF (GLB) converter, supporting Cesium Batch and Instance files (b3dm and i3dm) as well.
License: BSD 3-Clause "New" or "Revised" License
GLTF to Binary GLTF (GLB) converter, supporting Cesium Batch and Instance files (b3dm and i3dm) as well.
License: BSD 3-Clause "New" or "Revised" License
I have gltf (1.0) files with data uris that load correctly in aframe, but when I run them through your converter the glb is not correct.
$ ./gltf2glb.py -o ~/slicer4/latest/scenes/tumor/mrml.glb ~/slicer4/latest/scenes/tumor/mrml.gltf
Both data files are here:
https://github.com/pieper/scenes/tree/master/tumor
And here are two pages that load the two different models:
https://pieper.github.io/scenes/tumor/index.html
https://pieper.github.io/scenes/tumor/index-glb.html
I will probably be updating my exporter to gltf 2 to use the latest aframe and maybe that will help but thought I would report this anyway.
gltf2glb.py is coded against a GLTF schema which does not appear to be generated any longer by COLLADA2GLTF. Happily, COLLADA2GLTF now has native support for GLB export, so we should be able to just remove this file and keep the container formats.
HI,
Thank for your tools!
I have converted a gltf to b3dm file with success but when i use threejs GLTF loader to parse the b3dm file, i got this error:
GLTFLoader.js:980 Uncaught (in promise) TypeError: Cannot read property 'binary_glTF' of undefined
at GLTFLoader.js:980
at _each (GLTFLoader.js:592)
at GLTFLoader.js:978
at
Do you have any idea what is problem?
p/s : I can visualize my gltf file with this online demo without problem (please see attached file)
LYON_1ER_00033.zip
https://gltf-viewer.donmccurdy.com/
My gltf file has 21.4KB but the converted b3dm file takes 187KB, is it possible?
Thank for your reply!
Besides the performance benefits (and interoperability benefits for client code), this will obviate the need nestedListToBin
as a byte-buffer view of the array can be obtained with the .data
attribute. Additionally, numpy arrays are endian-aware, so we can still check if the array is big endian and get a vectorized conversion with .newbyteorder
if needed.
May be helpful if paired #13.
Hi, when I tried this tool, I got this syntax error:
File "gltf2glb.py", line 237
print b3dm_json
^
SyntaxError: invalid syntax
Any idea?
Hi, thanks for the great tool
is there any example how the JSON for instance semantics should look like ?
I didn't found how it should look like
and for example when I try some example I got errors like this one
ValueError: invalid literal for int() with base 10: 'id'
I have a question regarding the use of gltf2glb for converting gltf files to b3dm:
Should the batch table be like a json string denoting the attributes of the features, like this following one?
{ "id" : [0, 0, 0, 1, 1, 1, 2, 2],
"color" : ["yellow", "white", "white", "green", "blue", "red", "black", "white"] }
And if I'm understanding it correctly, each value of an attribute corresponds to one of the techniques specified in the gltf file?
Also, currently I have .gltf files that contain no information regarding the batch id.
Would it be possible that I use a batch table containing the batch ids (as in the json string I showed above that says "id") and convert the .gltf files to their .b3dm counterparts?
Python 2.7 has EOLed and should be considered a security risk. Time to upgrade to Python 3.
a) FeatureTable should not inherit from BatchTable, but both should probably share a base-class.
b) Terminology that is specific to client formats (e.g. "global" vs "instance-wise" vs "point-wise") should not be part of the generic class interface; however, we need to make sure it supports the sub-tables for extensions and extras.
c) There is no need for any mutation. Each *Table instance should be constructed from a single collection that represents the entire table, and handle encoding that collection into the separate JSON and binary buffer portions. The result should be treated as effectively immutable.
how to create a tileset with discrete LODs like the sample https://cesiumjs.org/NewYork/index.html
How does gltf2glb provide gltf2glb functionality?
"It has evolved to remove its first component (gltf2glb.py)"
You had one job!
/entitled rant
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.