Here I try to combine scratchapixel's articles to understand the operation of the camera-to-world matrix and ray direction vector. Here https://www.scratchapixel.com/lessons/3d-basic-rendering/ray-tracing-generating-camera-rays/generating-camera-rays.html if you scroll the last part is about generating a direction vector without converting pixel coordinates from raster space to NDC, then to screen. I decided to take that approach. But, after multiplying the direction vector with the camera-to-world matrix, there is no added translation vector to the direction vector's coordinates (that is the 4th vector of the matrix). Maybe the camera is placed at (0,0,0). Idk. Also, are LookAt and camera-to-world matrices the same thing?
lookAt
matrix transforms world coordinates to camera coordinates. The inverse of thelookAt
matrix transforms camera coordinates to world coordinates. $\endgroup$lookAt
matrix is A but not THE world-to-camera matrix. The same is true for the inverse. A "look at"-camera represents a camera model where the camera is focused on a point in space like in most strategy games. FPS use a different camera model, but the corresponding matrix that transforms between the camera and world coordinate system is also a camera-to-world matrix. $\endgroup$