Guest User

Untitled

a guest
May 25th, 2024
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. double x = (2.0 * drx::view::window.mouse.x) / w - 1.0; // -1.0 - 1.0
  2. double y = (2.0 * drx::view::window.mouse.y) / h - 1.0;
  3. drx::util::SPOT rayClip = { x, -y, z, 1.0 };
  4. drx::util::MAT4F projInv = this->projection.Inv();
  5. drx::util::MAT4F viewInv = this->GetView().Inv();
  6. drx::util::SPOT result = viewInv * projInv * rayClip;
  7. result = result.Divide(result.w);
Advertisement
Add Comment
Please, Sign In to add comment