Index: new-game.cpp
===================================================================
--- new-game.cpp	(revision 0424bd8d263f0e59e5952a2f565326b725820ad5)
+++ new-game.cpp	(revision a5b5e9569309fd79ce1fb681ae9dbc7a3fde53cd)
@@ -160,8 +160,8 @@
 
       //x = -.1f;
-      x = -.25f;
+      //x = -.25f;
       //x = -.5f;
 
-      y = .1f;
+      //y = .1f;
 
       cout << "x: " << x << ", y: " << y << endl;
@@ -181,5 +181,5 @@
 
       //vec4 ray_clip = vec4(0.0f, 0.0f, NEAR_CLIP, 1.0f); // this should have a z equal to the near clipping plane
-      vec4 ray_clip = vec4(x, y, 0.0f, 1.0f); // this should have a z equal to the near clipping plane
+      vec4 ray_clip = vec4(x, y, NEAR_CLIP, 1.0f); // this should have a z equal to the near clipping plane
       vec4 ray_eye = ray_clip;
       vec3 ray_world = (inverse(view_mat) * ray_eye).xyz();
@@ -189,21 +189,12 @@
        * Normalizing the world ray caused issues, although it should make sense with the projection
        * matrix, since the z coordinate has meaning there.
-       *
-       * Now, I need to figure out the correct intersection test in 2D space
-       * Also, need to check that the global triangle points are correct
        */
 
       printVector("Initial world ray:", ray_world);
 
-      // Theoretically, I should be able to change the z of the camera to whatever I want.
-      // Figure out why I can't.
-      // Remember that ray_world has to be a ray along the click line, not any point along it
-      // vec3 cam_pos_temp = ray_world;
-      // ray_world = vec3(0.0f, 0.0f, 1.0f);
-
-      vec3 cam_pos_temp = vec3(ray_world.xy(), 0.0f);
+      vec4 cam_pos_origin = vec4(x, y, 0.0f, 1.0f);
+      vec3 cam_pos_temp = (inverse(view_mat) * cam_pos_origin).xyz();
+
       ray_world = ray_world-cam_pos_temp;
-
-      // upper right corner is 1, 1 in opengl
 
       cout << "Ray clip -> (" << ray_clip.x << "," << ray_clip.y << "," << ray_clip.z << ")" << endl << endl;;
@@ -484,5 +475,5 @@
 
    //cam_pos = vec3(0.0f, 0.0f, 2.0f);
-   cam_pos = vec3(0.0f, 0.0f, 0.0f);
+   cam_pos = vec3(0.3f, 0.0f, 0.3f);
    float cam_yaw = 45.0f * 2.0f * 3.14159f / 360.0f;
 
