Created
June 13, 2012 17:08
-
-
Save jlivni/2925302 to your computer and use it in GitHub Desktop.
binary data for webgl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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