Naive bash script to convert a Wavefront OBJ (as created by Blender) into JavaScript arrays:
$ ./obj2js < model.obj > model.js
Will print something like:
var vertices = [
1.000000, -1.000000, -1.000000,
1.000000, -1.000000, 1.000000,
-1.000000, -1.000000, 1.000000,
-1.000000, -1.000000, -1.000000,
1.000000, 1.000000, -0.999999,
0.999999, 1.000000, 1.000001,
-1.000000, 1.000000, 1.000000,
-1.000000, 1.000000, -1.000000,
], indicies = [
0, 1, 2,
4, 7, 6,
0, 4, 5,
1, 5, 6,
2, 6, 7,
4, 0, 3,
]