DavidNorgren

Untitled

May 25th, 2015
292
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. Ray Camera::castRay(vec2 pos, float ratio) {
  2.     float tfov = dtan(fov / 2.f);
  3.     vec3 dir = (xaxis * tfov * ratio * pos.x + yaxis * tfov * pos.y + zaxis).normalize();
  4.     return Ray(position, dir);
  5. }
Advertisement
Add Comment
Please, Sign In to add comment