title: Generate and export point cloud from Project Tango
body: <p>After some weeks of waiting I finally have my Project Tango. My idea is to create an app that generates a point cloud of my room and exports this to .xyz data. I'll then use the .xyz file to show the point cloud in a browser! I started off by compiling and adjusting the point cloud example that's on Google's github.</p>
  
  <p>Right now I use the <code>onXyzIjAvailable(TangoXyzIjData tangoXyzIjData)</code> to get a frame of x y and z values; the points. I then save these frames in a PCLManager in the form of <code>Vector3</code>. After I'm done scanning my room, I simple write all the <code>Vector3</code> from the PCLManager to a .xyz file using:</p>
  
  <pre><code>OutputStream os = new FileOutputStream(file);
  size = pointCloud.size();
  for (int i = 0; i &lt; size; i++) {
      String row = String.valueOf(pointCloud.get(i).x) + " " 
                 + String.valueOf(pointCloud.get(i).y) + " " 
                 + String.valueOf(pointCloud.get(i).z) + "\r\n";
      os.write(row.getBytes());
  }
  os.close();
  </code></pre>
  
  <p>Everything works fine, not compilation errors or crashes. The only thing that seems to be going wrong is the rotation or translation of the points in the cloud. When I view the point cloud everything is messed up; the area I scanned is not recognizable, though the amount of points is the same as recorded. </p>
  
  <p>Could this have to do something with the fact that I don't use PoseData together with the XyzIjData? I'm kind of new to this subject and have a hard time understanding what the PoseData exactly does. Could someone explain it to me and help me fix my point cloud? </p>