I am currently looking into [glTF][1] to use as a transfer format for my WebGL project. I already have the geometries I wish to render on my WebGL client available as preprocessed vertex and index buffers (and color buffers, but let's ignore them for now).

For example:

    [       // vertex buffer
      0,0,0,
      0,1,0,
      1,0,0,
      1,1,0,
    ]

And to draw simple `LINES`:

    [       // index buffer
      0,2,
      2,4,
      4,0,
      0,1,
      1,4,
    ]

I wonder how to create glTF files containing these buffers? Is this possible?

I want to avoid using COLLADA and [COLLADA2GLTF][2] as this would only add an additional step and might just bloat the resulting glTF files.


  [1]: https://github.com/KhronosGroup/glTF/blob/master/specification/README.md
  [2]: https://github.com/KhronosGroup/glTF/wiki/converter