*blog... kind of... *rss
My take on the RA DIOHEA_D / HOU SE OF_C ARDS thing
1 commentI'm sure you have heard of that radiohead's opensource music video by now, and if you consider yourself a proper geek you have also played around with the data. At first I wasn't too motivated on doing anything on it, but as I was playing around with voxels I wondered how would the data look like, so yeah, another geek for the bag.
Displaying the first frame was more or less easy, the biggest job on this is optimising the data to something easier to handle online. Each frame in the original data is 400kb, so I was quite happy when I managed to get it down to 30kb myself. Add it the 9kb of my (in the works) 3d engine, and you got a 39kb .swf:
HOW-TO USE:
Mouse left-right: Move camera left-right.
Mouse up-down: Move camera up-down.
Mouse wheel: Move camera forward-backwards.
(MaOS users: key up/key down)

Reducing the data in this case was basically converting all the float values to integers, and then just saving the deltas instead of the real values. This is, if you have (80,80,80), and the next points are (81,81,81), you only save the difference (1,1,1), that would then compress very well, specially because you will end up with a lot of 0s and 1s. Actually, if the value was 0, I would just delete it so I would save (2,,1). The code you need for reconstructing the data is very tiny so it's really worth the work :) Then I saved the whole thing as a string, and added in the actionscript code, flex did the rest when (zip) compressing the final .swf.
Having this done, I showed to some friends, and they were all asking "Doesn't it move?". Oh well... time for a long night ;) After a couple of tests and learning to use byteArrays and stuff like that I managed to have 1000 frames in 40Mb (zipped). Which is 10% of the original. At first I had them at 33Mb (in ASCII), but the process of reconstructing the data was too hard/slow for actionscript and also for the user's memory (1GB+), so the 40Mb option was the best. I'm sure Iq would've been able to reduce the 2000 frames to 5Mb, but well. (Kudos to him for sharing all these compressing tricks btw :D)
This is what I got in the end:
HOW-TO USE:
Same controls as before, but with an extra of patience :P

I also used in the experiment Fzip which did a great job.
I'm not sharing the sources on this one because I'm still working on that 3d engine and I'm still moving things around, but I should be able to release it (and many other tests) in a few weeks (yeah, I know I always say that). However, I can share the php script I did for parsing the frames.
EDIT: Wow, Aaron (the guy that did the original flash visualiser) wrote me asking if I was using shorts (numbers), and I wasn't, because I didn't know there was something smaller than Ints :$. So I've just changed the script to save the info using shorts and the zip now is 33Mb, so 7Mb reduction there :D I've also fixed a bug that sole spotted on the animator.
Displaying the first frame was more or less easy, the biggest job on this is optimising the data to something easier to handle online. Each frame in the original data is 400kb, so I was quite happy when I managed to get it down to 30kb myself. Add it the 9kb of my (in the works) 3d engine, and you got a 39kb .swf:
HOW-TO USE:
Mouse left-right: Move camera left-right.
Mouse up-down: Move camera up-down.
Mouse wheel: Move camera forward-backwards.
(MaOS users: key up/key down)

Reducing the data in this case was basically converting all the float values to integers, and then just saving the deltas instead of the real values. This is, if you have (80,80,80), and the next points are (81,81,81), you only save the difference (1,1,1), that would then compress very well, specially because you will end up with a lot of 0s and 1s. Actually, if the value was 0, I would just delete it so I would save (2,,1). The code you need for reconstructing the data is very tiny so it's really worth the work :) Then I saved the whole thing as a string, and added in the actionscript code, flex did the rest when (zip) compressing the final .swf.
Having this done, I showed to some friends, and they were all asking "Doesn't it move?". Oh well... time for a long night ;) After a couple of tests and learning to use byteArrays and stuff like that I managed to have 1000 frames in 40Mb (zipped). Which is 10% of the original. At first I had them at 33Mb (in ASCII), but the process of reconstructing the data was too hard/slow for actionscript and also for the user's memory (1GB+), so the 40Mb option was the best. I'm sure Iq would've been able to reduce the 2000 frames to 5Mb, but well. (Kudos to him for sharing all these compressing tricks btw :D)
This is what I got in the end:
HOW-TO USE:
Same controls as before, but with an extra of patience :P

I also used in the experiment Fzip which did a great job.
I'm not sharing the sources on this one because I'm still working on that 3d engine and I'm still moving things around, but I should be able to release it (and many other tests) in a few weeks (yeah, I know I always say that). However, I can share the php script I did for parsing the frames.
EDIT: Wow, Aaron (the guy that did the original flash visualiser) wrote me asking if I was using shorts (numbers), and I wasn't, because I didn't know there was something smaller than Ints :$. So I've just changed the script to save the info using shorts and the zip now is 33Mb, so 7Mb reduction there :D I've also fixed a bug that sole spotted on the animator.
Fantastic job !!
March 14th 2010, Uriel
*profile

traditional id: Ricardo Cabello Miguel
based in: London, UK
more: github, twitter, twitpic, soundcloud and flattr
*post nav
Ronny Pries live @ Alpha Box Jan'08
WALL·E
Where do we get the time from?
And now... can flash render a 320k+ voxels head?
Pixel Attack 08 - 3D Slides
My take on the RA DIOHEA_D / HOU SE OF_C ARDS thing
Story of Stuff
FabricLive 40 DJ Noisia
Can BitmapData.setPixel() fill your Browser at ~30fps?
Yet another 3D Clock (D///FEST holding page)
How-to unlock your Vodafone UK mobile phone