Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double x = (2.0 * drx::view::window.mouse.x) / w - 1.0; // -1.0 - 1.0
- double y = (2.0 * drx::view::window.mouse.y) / h - 1.0;
- drx::util::SPOT rayClip = { x, -y, z, 1.0 };
- drx::util::MAT4F projInv = this->projection.Inv();
- drx::util::MAT4F viewInv = this->GetView().Inv();
- drx::util::SPOT result = viewInv * projInv * rayClip;
- result = result.Divide(result.w);
Advertisement
Add Comment
Please, Sign In to add comment