I would like to perform the calculation manually in that case, but I'm not exactly sure what transformations are involved. I am trying to convert points from NDC space to camera space. I can see that one part of it is to use the camera matrix like this:
matrix cam_matrix = maketransform(0, 0, cam_position, cam_rotation); @P *= cam_matrix;
That brings the points in the correct position/rotation in the scene, but there is something missing - I'm not sure if it is a screenspace or clip space or view space or something else transformation which also needs to occur to get the same result as the 'fromNDC' function.
I have attached a project showing the two methods (1) fromNDC, and (2) the incomplete method doing it by hand.
Can anyone help me?