To distribute our models we have selected to use a very simple format often referred to as an XYZRGB file. The files are ASCII text files with each line containing a single point consisting of the following attributes,
PositionX PositionY PositionZ
ColorR
ColorG
ColorB
[PositionX], [PositionY] and [PositionZ] are all described as floating point numbers, while the colors [ColorR], [ColorG] and [ColorB] are unsigned bytes described as values from 0-255.
Cloud compare works on Windows, OSX and Linux and is one of the most powerful tools out there to work with pointlcoud datasets. Best yet, it is free!
Meshlab works on Windows, OSX and Linux and has a very good rendering engine. While Meshlab is designed for meshes, it also has a built in pointcloud viewer. This tool also has good mechanisms to convert points to meshes.
Below is example code in C++ that can be used to parse these files
#include
struct Point
{
float p[3];
unsigned char c[3];
};
std::vector ReadPoints(char *filename)
{
std::vector points;
FILE *f = fopen(filename, "r");
while (
fscanf( f,
"%f %f %f %d %d %d\n",
&readX, &readY, &readZ, &readR, &readG, &readB
) == 6
)
{
Point* p = new Point();
point->p[0] = readX;
point->p[1] = readY;
point->p[2] = readZ;
point->c[0] = readR;
point->c[1] = readG;
point->c[2] = readB;
points.push_back(point);
}
fclose(f);
return points;
}
We wanted a file format that would be maximally accesible, both now and in the future. A ASCII text-based system should enable users to understand the data structure with limited documentation, and not leave the data bound to any one program.
While you could use these directly, you would likely want to convert these files into another format. While text files require the computer to parse these files into points, binary files enable the possibility for these files to be read directly.
In aims of optimizing the data to be downloaded, we have only included the color attribute for each point. While these other elements may be useful in the future, at the time this website was created they have not shown enough utility to warrant their inclusion.
The scanner used to acquire the homes only captured colors in 8-bits per channel as opposed to 16-bits per color.