Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// OSZTÁLYON KÍVÜL
- // Visszaverõdés
- // R_r = R_in - 2N(R_in.N) egyenlõséget használva
- template <class T>
- inline Vec3<T> reflection(const Vec3<T>& in, const Vec3<T>& surface_normal)
- {
- Vec3<T> N = normalized(surface_normal);
- Vec3<T> R = normalized(in);
- return (R - ((T)2*N) * R.dot(N));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement