title: Using OpenGL shaders to plot 4D points in 2D in C++
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6988686/visualising-4d-objects-in-opengl">Visualising 4D objects in OpenGL</a>  </p>
  </blockquote>
  
  
  
  <p>I have a set of 4 dimensional data points (lets call the dimensions X,Y,A, and B) that I'd like to plot in 6 different 2d plots (plot XxY, XxA, XxB, YxA, etc...). </p>
  
  <p>In a previous question <a href="https://stackoverflow.com/questions/6929927/best-way-to-draw-scatter-plot-with-lots-of-data-points-in-c-using-opengl">I asked about the proper way to store and plot this data</a>. The solution was to use a VBO that stored the 4 dimensional vertices.  Then using different vertex shaders I could select which dimensions are plotted in each of the 2d plots.</p>
  
  <p>I've spent a few weeks looking around for openGL tutorials on how to do this but I haven't yet found something that makes sense.</p>
  
  <p>My question is this: In c++, how can I define a shader that would allow me to plot only 2 dimensions of a 4 dimensional point in a VBO, and do I need to define a single shader for all 6 2d plots or do I need a shader for each of 6 different plots? </p>
  
  <p>Finally how do I incorporate the shader into the plotting code so it gets used by openGL?</p>