jeudi 12 février 2015

ThreeJS Loading a Texuture from a raw javascript ArrayBuffer


Given an Javascript ArrayBuffer with the binary data of a image and the extension (jpg, png , etc) I would like to create a ThreeJS Texture (without doing any HTTP request or file load as I already have the binary information).


For instance suppose I have :



var binaryData = getBinaryData(); // this returns an ArrayBuffer with the image, for this example we assume is a PNG image.
var imageFormat = "png";


(and also we have the other texture properties as the wrap mode, mipmaps, etc)


How I can load the Texture ?


Any help will be appreciated.





Aucun commentaire:

Enregistrer un commentaire