title: Cuda + OpenGL : How to display elements of an array
body: <p>Lets say that an array of data  </p>
  
  <pre><code>int data[256][256][256];
  </code></pre>
  
  <p>contains values of 0 and 1.
  This data will be copied to device memory (flattened) and processed by cuda kernel changing some values from 0 to 1 and vice versa.
  How can i display the data in such a way so </p>
  
  <pre><code>if data[x]][y][z]==1
  {
  //a point of size 1 will be displayed in (x,y,z) coords
  }
  </code></pre>
  
  <p>without having to copy that array back to host memory. I want to do it directly from device(gpu) memory.
  A simple example would be very helpfull.</p>