<p>I've finally managed to write the buffers myself using <a href="https://jsfiddle.net/6cevt681/1/" rel="nofollow noreferrer">JavaScript</a>.</p>

<p>The result is a base64 encoded String, like:</p>

<pre><code>data:application/octet-stream;base64,AAACAAIABAAEAAAAAAABAAEABAB7g689dnGbPb1SFj1Q/Hg/vsF3P7hAAj3Qs3k/bcVuPw==
</code></pre>

<p>If you paste this Data URI into the browser, you can download a binary blob which is exactly what the glTF files can use.</p>

<p><a href="https://i.sstatic.net/x2dxF.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/x2dxF.png" alt="enter image description here"></a></p>

<p>The 52 bytes in this case contain 10 indices of 2 bytes size (<code>U_SHORT</code>) and 8 vertices of 4 bytes size (<code>FLOAT</code>), so <code>10 * 2 B + 8 * 4 B = 52 B</code>.</p>

<p>See <a href="https://computergraphics.stackexchange.com/a/3624/361">this post</a> to find out how I generated the buffer and see <a href="https://computergraphics.stackexchange.com/a/3623/361">this answer</a> on how to read the data again.</p>

CC BY-SA 3.0
2016-06-15T19:03:36.683Z
2016-06-15T19:03:36.683Z
2017-04-13T13:00:43.660Z
q9f
<p>Technically any file format where you can dump the entire file into a VBO and then render from that will work for the .bin files. Unfortunately those formats are less well known than they should be.</p>

<p>Then you only need to adjust the bufferview elements to reference the proper subset of the file</p>

CC BY-SA 3.0
2016-04-19T09:53:41.033Z
2016-04-19T09:53:41.033Z
ratchet freak
<p>I'm looking for any way which enables me to quickly generate gltf files including the conversion of plain array buffers (vertex, index, color, etc.) into binary (bgltf, glb, bin) files.</p>

<p>I'm asking because it currently looks like there are only high level applications like Maya, Blender available which can do that or converters to indirectly write glTF from COLLADA.</p>

<p>Are there any way to generate binary gltf array buffers using low level / command line utilities?</p>

<data-structure><gltf><buffers>
How to generate binary gltf array buffers?
q9f
# How to generate binary gltf array buffers?

(Asked by: username_0 on 2016-04-19)

I'm looking for any way which enables me to quickly generate gltf files including the conversion of plain array buffers (vertex, index, color, etc.) into binary (bgltf, glb, bin) files.

I'm asking because it currently looks like there are only high level applications like Maya, Blender available which can do that or converters to indirectly write glTF from COLLADA.

Are there any way to generate binary gltf array buffers using low level / command line utilities?

**Tags:** data-structure, gltf, buffers


---

## 2 answers

### Answer by username_0 on 2016-06-15. Score: 2 | Accepted answer

I've finally managed to write the buffers myself using [JavaScript](https://jsfiddle.net/6cevt681/1/).

The result is a base64 encoded String, like:

```
data:application/octet-stream;base64,AAACAAIABAAEAAAAAAABAAEABAB7g689dnGbPb1SFj1Q/Hg/vsF3P7hAAj3Qs3k/bcVuPw==

```

If you paste this Data URI into the browser, you can download a binary blob which is exactly what the glTF files can use.

[![enter image description here](https://i.sstatic.net/x2dxF.png)](https://i.sstatic.net/x2dxF.png)

The 52 bytes in this case contain 10 indices of 2 bytes size (`U_SHORT`) and 8 vertices of 4 bytes size (`FLOAT`), so `10 * 2 B + 8 * 4 B = 52 B`.

See [this post](https://computergraphics.stackexchange.com/a/3624/361) to find out how I generated the buffer and see [this answer](https://computergraphics.stackexchange.com/a/3623/361) on how to read the data again.


---

### Answer by username_1 on 2016-04-19. Score: 2

Technically any file format where you can dump the entire file into a VBO and then render from that will work for the .bin files. Unfortunately those formats are less well known than they should be.

Then you only need to adjust the bufferview elements to reference the proper subset of the file


---

