Advertisement
mrpowhs

Untitled

Feb 9th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. /// OSZTÁLYON KÍVÜL
  2.  
  3. // Visszaverõdés
  4. // R_r = R_in - 2N(R_in.N) egyenlõséget használva
  5. template <class T>
  6. inline Vec3<T> reflection(const Vec3<T>& in, const Vec3<T>& surface_normal)
  7. {
  8.     Vec3<T> N = normalized(surface_normal);
  9.     Vec3<T> R = normalized(in);
  10.     return (R - ((T)2*N) * R.dot(N));
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement