• Hey! Guest! The 40th (!!!) GMC Jam will take place between February 25th, 12:00 UTC to March 1st 12:00 UTC. Why not join in this very special anniversary jam! Click here to find out more!

3D Finding Camera to World Matrix


I've been struggling trying to create a function that converts 2d screen coordinates into a 3d raycast. I think I've found a good way to do it, but it involves transforming a directional vector from camera-space to world-space.

I understand that in order to convert world-space coordinates to camera-space coordinates you can multiply a point by the camera's view matrix with matrix_transform_vertex(view, x, y, z).

But how do you go from camera-space to world-space? Would you instead multiply the point by the inverse of the view matrix? From my understanding matrix inversion is a very complicated topic and Gamemaker does not have any matrix_inverse functions.

Or is there another way to transform from camera-space to world-space?
Any tips would be greatly appreciated.