[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] ArrayBuffer, Concatenation and String-Array Conversion, a proposal



On Oct 5, 2010, at 2:04 PM, Samuel Kleiner wrote:

> 
>> The question here is why isn't there a function for doing these conversions between JavaScript Strings and Arrays? I suppose the answer is that it's not common enough; storing a unicode value in an array isn't done very much.
> 
> I think it will be.
> 
> My use case here would be to send, as single  JSON file, a complete 3d model in a format parsable by javascript. In the ideal case, that 3d model could include shader code, and binary data. JSON can be parsed using the built-in accelerated function for doing so, but then you need a way of transforming likely large blocks of text to array buffers.

But what do these strings contain? Unicode characters which correspond to some sort of encoded binary representation of floating point values? If so, then you'll need some way to convert from a pure binary form into your encoded form. At that point wouldn't it be easier to use XHR and send the binary data directly?

-----
~Chris
cmarrin@apple.com




-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email: