title: How to move a camera using in a ray-tracer?
body: <p>I am currently working on ray-tracing techniques and I think I've made a pretty good job; but, I haven't covered camera yet. </p>
  
  <p>Until now, I used a plane fragment for view plane which is located between <code>(-width/2, height/2, 200)</code> and <code>(width/2, -height/2, 200)</code> [200 is just a fixed number of z, can be changed]. </p>
  
  <p>Addition to that, I use the camera mostly on <code>e(0, 0, 1000)</code>, and I use a perspective projection. </p>
  
  <p>I send rays from point <code>e</code> to pixels, and print it to image's corresponding pixel after calculating the pixel color.<img src="https://i.stack.imgur.com/VGIxO.jpg" alt="enter image description here"></p>
  
  <p>Here is a image I created. Hopefully you can guess where eye and view plane are by looking at the image.</p>
  
  <p>My question starts from here. It's time to move my camera around, but I don't know how to map 2D view plane coordinates to the canonical coordinates. Is there a transformation matrix for that? </p>
  
  <p>The method I think requires to know the 3D coordinates of pixels on view plane. I am not sure it's the right method to use. So, what do you suggest?</p>