title: My OpenGl 3D Tetris game has square cubes, but they are vanishing to infinity in the background, what is wrong?
body: <p>I am making a 3d Tetris game, I have defined my cubes in 3d, and set up a LookAt and a Frustum matrix to view the game.</p>
  
  <p>The game works fine with a Orthographic matrix, but when I switch to Frustum all the cubes vanish to infinity to the background.</p>
  
  <p>The Tetris pieces are all defined in the +,+ quadrant if you think of it like a Euclidian grid.</p>
  
  <p>The pieces have length, width and height of 33.</p>
  
  <p>I first have a matrix that centers the entire game to 0, 0 so the game is in all 4 quadrants, than I have a LookAt matrix that the camera is at 0,0,0 and looking at 0,0,0.</p>
  
  <p>Then now if I have a orthographic matrix, it looks fine, but if I switch to a Frustum, it looks like the <img src="https://i.stack.imgur.com/m0Ifh.png" alt="attached picture."></p>
  
  <p>Here is an example of 1 of 4 cubes that make up a Tetris tile's vertices:</p>
  
  <pre><code>( 132, 660, 16.5, 1 )( 165, 660, 16.5, 1 )( 165, 693, 16.5, 1 )( 132, 660,     16.5, 1 )( 165, 693, 16.5, 1 )( 132, 693, 16.5, 1 )( 165, 660, 16.5, 1 )( 165, 660, -16.5, 1 )( 165, 693, -16.5, 1 )( 165, 660, 16.5, 1 )( 165, 693, -16.5, 1 )( 165, 693, 16.5, 1 )( 165, 660, -16.5, 1 )( 132, 660, -16.5, 1 )( 132, 693, -16.5, 1 )( 165, 660, -16.5, 1 )( 132, 693, -16.5, 1 )( 165, 693, -16.5, 1 )( 132, 660, -16.5, 1 )( 132, 660, 16.5, 1 )( 132, 693, 16.5, 1 )( 132, 660, -16.5, 1 )( 132, 693, 16.5, 1 )( 132, 693, -16.5, 1 )( 132, 660, -16.5, 1 )( 165, 660, -16.5, 1 )( 165, 660, 16.5, 1 )( 132, 660, -16.5, 1 )( 165, 660, 16.5, 1 )( 132, 660, 16.5, 1 )( 132, 693, 16.5, 1 )( 165, 693, 16.5, 1 )( 165, 693, -16.5, 1 )( 132, 693, 16.5, 1 )( 165, 693, -16.5, 1 )( 132, 693, -16.5, 1 )
  </code></pre>
  
  <p>Here is where I set up my matrices:</p>
  
  <pre><code>vec4 eye(0, 0, 17, 1.0);
  vec4  at(0, 0, 0, 1.0 );
  vec4  up( 0.0, 1.0, 0.0, 1.0);
  
  mat4  mv = LookAt( eye, at, up );
  
  mat4 center;
  // window is 400 x 720, translating the game
  // to make the game center at the origin
  center[0][3] = -200;
  center[1][3] = -360;
  
  mv = mv * center;
  
  glUniformMatrix4fv( model_view, 1, GL_TRUE, mv );
  
  mat4  p = Frustum(-200, 200, -360, 360, 1, 45);
  </code></pre>
  
  <p>If I change the Frustum to Ortho above the game looks like this: <img src="https://i.stack.imgur.com/FF5Ku.png" alt="enter image description here"></p>
  
  <p>If I change the coordinates of the camera eye at all, the entire game visually messes up and doesn't make sense to why. Even if I move the camera up one pixel. This also happens in Ortho projection, and I don't understand why.</p>