title: Mapping vertex 0-7 to 3D points?
body: <p>I have 8 vertices of a cube that are simply indexes. I want to get every vertex's respective point of where it would be in a normalized cube. In the following diagram, assume that +x is to the right, +y is up, and +z is coming out of the screen. (vertices 2, 3, 6, and 7 are in front, if it's hard to see).</p>
  
  <p><img src="https://i.stack.imgur.com/eDRr8.gif" alt="Polygonise"></p>
  
  <p><sup>(ignore the edge indexes)</sup></p>
  
  <p>Here's what I have:</p>
  
  <pre><code>for (int v = 0; v &lt; 8; v++) {
      float x, y, z;
  
      if(v &lt; 4)                                    y = -1;
      else                                         y = +1;
      if(v == 1 || v == 2 || v == 5 || v == 6)     x = +1;
      else                                         x = -1;
      if(v == 2 || v == 3 || v == 6 || v == 7)     z = +1;
      else                                         z = -1;
  }
  </code></pre>
  
  <p>Is there a more logical way to do this, without so many logical ORs?</p>