wasdqe and arrow keys People have asked me about this a few times now, it must be the second most asked question after “why is the sky blue”, so making this project seemed like a good idea. I also put a diagram, which might be more helpful than the rest of the explanation. The rest of the explanation: Note that I use x to point to the right, y is forwards and z is up, so camera yaw rotates the point’s xy, around the z axis, then pitch rotates zy around the x axis. Also, positive camera angles mean up / to the right but since we are rotating the world not the camera, the points turn in the opposite direction. It's important to know exactly what cosine means, cos(θ) tells you how much something pointing θ degrees away from a direction is “still in that direction”, so if you rotate a line 45 degrees, the distance that the line travels in the old direction is L * cos(45), while sine is for how far it now travels perpendicular to that direction. First subtract the camera's position from the point since you only care about the difference in position, you don't need to store them in variables but you should because it makes the code much clearer. Then you rotate it (the difference in position) horizontally by multiplying the x and y components by cos(θ) and adding x*sin(θ) to the y and subtracting y*sin(θ) from the x (since turning anticlockwise means +y rotates away from the +x axis), and the vertical (z) position stays the same. Then do the same thing for vertical rotation, you have to do vertical rotation after horizontal otherwise it messes it up. Then project them with (x/y, z/y). Make sure you alternate between two sets of variables for the rotations because after you find the rotated x, you need to use the old x calculating the rotated y. Maybe that seems obvious, but when I was learning this I wasted a long time getting confused because I didn't notice it.