|
Author |
Topic: En/Decoding a binary file.. (Read 691 times) |
|
skloopy
|
En/Decoding a binary file..
« on: Mar 5th, 2005, 2:10am » |
|
I'm trying to write some particle data to a pdc (maya particle disk cache). Alias only has one little page on the format, but it says the pdc file is a binary file. For now I'm just trying to read this test file. http://elfman.vendetta.com/ryan/particleShape1.6000.pdc I've looked all over for how to read a binary file like that, but I haven't found much. I know that loadBytes() is supposed to do it, but this file has strings and numbers in it. The strings come through fine when I use loadStrings() but the numbers get all garbled. I think there's something simple I'm missing.. Any ideas anybody? Thanks! ryan
|
|
|
|
fjen
|
Re: En/Decoding a binary file..
« Reply #1 on: Mar 5th, 2005, 9:12am » |
|
hi ryan, i had a similar problem with my alice2.0 importer ... see here how to do it: http://www.florianjenett.de/p55/byte_juggle.pde i guess they use either some marker (return, tab?) to differentiate between strings and numbers, or fixed lengths for the string-pieces. trial&error ... /F
|
|
|
|
skloopy
|
Re: En/Decoding a binary file..
« Reply #2 on: Mar 8th, 2005, 3:32am » |
|
Thanks Florian! That was just the info I needed. It turned out i needed to do the opposite of your Alice loader, because I wanted to write files ultimately. Writing the code to load the files helped me figure out how to write em tho. Wahaha i'm sucha a hacker! J/K i'm not really. Just feels that way. If you're interested I can post a demo or something. It wouldn't be much good as an applet because file writing is the main function. anyways thanks!
|
|
|
|
|