title: Ray tracing box intersections
body: <p>So I'm back with another ray tracing question. My code renders spheres all fine and dandy, but cubes aren't really working. I'm using this code to test for intersections: <a href="http://pastebin.com/qgm6vpdx" rel="nofollow">http://pastebin.com/qgm6vpdx</a> (It's a recursive function, t is the distance to the intersection point)
  The bounding box is defined as: </p>
  
  <pre><code>Cube* c1 = new Cube;      
  c1-&gt;Corner1 = Vec3(100, 100, 100);      
  c1-&gt;Corner2 = Vec3(200, 200, 200);
  </code></pre>
  
  <p>I've confirmed that the camera is not inside the cube.
  Now, the only problem is that the entire screen shows up as green (the color designated to the cube)</p>
  
  <p>I don't think I'm doing the cube intersections right, can anyone proof read my code?</p>