How do I draw a point in world coordinate space (where the camera is currently looking at, so that would be view*projection correct?)
I would think I would need to do something like:
PositionInWorld = MousePositionInNDC * view * projection?
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.Sign up to join this community
If you want exactly in the center of the camera's field of view, then what you can do is to take a 3d vector pointing in the monitor (aka. (0; 0; -1)), create a 3x3 rotation matrix with the same angles your camera has and multiply these together, this results in a 3d vector rotated to match the camera's ditection. To get a point
x distance from the camera, you multiply this vector with
x and you add it to the camera's position.
If you only have access to 4x4 matrices (for example if you use unity), then do everything as above but with a 4d vector and a 4x4 matrix, and before you add the vector to the camera's position, downgrade it to a 3d vector.