- Home /
Question by
BugVito · Oct 17, 2012 at 06:16 PM ·
directionrayprojection
Ray direction, projection matrix
Hi, A custom projection matrix is applied to the main camera, and I need to create a Ray when a mouse click occurs (the point in world space under the mouse position, where the first object is "hit").
I do have the origin in world coordinate, the screen coordinate of the mouse, and the projection matrix itself. That origin is not necessarily the point from which the projection matrix is computed from.
Here is my issue, I have tried many different ways of computing the direction, or finding the far-end point (which I can then easily compute the direction from), but I keep getting odd results.
Anybody can help me with this one?
Thanks!
Comment