Fixing Ro.me’s Turbulent Point Cloud October 24, 2011Posted by Andor Salga in Open Source, point cloud, webgl, XB PointStream.
A few days ago I noticed the turbulent point cloud demo for ro.me was no longer working in Firefox. Firefox now complains that the array being declared is too large. If you look at the source, you’ll see the entire point cloud is being stuffed into an array, all 6 megabytes of it. Since it no longer works in Firefox, I thought it would be neat to port the demo to XB PointStream to get it working again.
Stealing Some Data…
I looked the source code and copied the array declaration into a empty text file.
var array = [1217,-218,40,1218,-218,37,....];
So I had the data, which was great, but I needed it to be in a format XB PointStream could read. I had to format the vertices to look something like this:
1217 -218 40 1218 -218 37 ...
Once I had the point cloud loaded in XB PointStream, I needed to add some turbulence. I could have used the shader which the original demo used, but I found a demo by Paul Lewis which I liked a bit better. The demo isn’t quite as nice as the original, but given more time I could incorporate the original shader as well to make it just as good.