Skip to content

Instantly share code, notes, and snippets.

@jlivni
Created June 13, 2012 17:08
Show Gist options
  • Save jlivni/2925302 to your computer and use it in GitHub Desktop.
Save jlivni/2925302 to your computer and use it in GitHub Desktop.
binary data for webgl
#appengine python
values = [1,2,3,4]
values = array('f',values)
response.out.write(values.tostring())
//JS loading
var xhr = new XMLHttpRequest();
xhr.open('GET', '/path/to/file', true);
xhr.responseType = 'arraybuffer';
xhr.onload = function(e) {
var binaryArray = new Float32Array(this.response);
};
xhr.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment