# Defining ray direction vector

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?

• Welcome to computer graphics stack exchange! the lookAt matrix transforms world coordinates to camera coordinates. The inverse of the lookAt matrix transforms camera coordinates to world coordinates. Jun 28 at 11:56
• Adding to @Thomas answer: The 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. Jun 28 at 12:31
• I got it. I am mainly interested in whether does row-majored LookAt matrix contains the camera's coordinates as its 4th row. I know that camera-to-world contains it. Jun 28 at 15:07