jump to navigation

Fixing Ro.me’s Turbulent Point Cloud October 24, 2011

Posted by Andor Salga in Open Source, webgl, XB PointStream, point cloud.

Run me
Turbulent Point Cloud

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


Using JavaScript to do the conversion only made sense, but I first had to split up the file which contained my array declaration so Firefox could actually load it. After some manual work, I had 6 files—each with its own smaller literal array.

I then wrote a JavaScript script which loaded each array and dumped the formatted text into a web page. I ran my script and copied the output several times until I had the entire file reconstructed as an .ASC file.

Adding Turbulence

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.


1. Habibi - October 25, 2011


2. vangelis - October 25, 2011

Hi andor.Great job.If only the ply parser could take textures too it would be great.See for example meshlab ply file type can export texture and texture coordinates Are you intending to change the ply parser in order to do that?

3. Andor Salga - October 25, 2011

We don’t have support for textures because typically the point clouds are dense enough that we just color each point. So baking the texture into the cloud is probably what you want.

vangelis - October 25, 2011

That’s Interesting but i don’t know how to do that.Can you point me?

Andor Salga - October 27, 2011

I haven’t done it myself, but I wouldn’t be surprised if Meshlab had a function to do it. Can you point me to your file, is it online?

vangelis - October 28, 2011

I don’t have anything online but just try with any 3d file that has textures and save it as .ply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

%d bloggers like this: