diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2020-12-21 01:26:14 +0100 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2020-12-21 01:26:14 +0100 |
| commit | 92d66138f53645f3400f633c9821a6fa36f589e0 (patch) | |
| tree | a23bc2f45afa5858095ba5525a61aad530fdddd6 /include | |
| parent | 25ac4fd14409a0d82bbaaaf4018674c3bdd46b03 (diff) | |
Add lambertian reflection to spheres
Diffstat (limited to 'include')
| -rw-r--r-- | include/vec3.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/vec3.hpp b/include/vec3.hpp index 4ab446d..7b0e469 100644 --- a/include/vec3.hpp +++ b/include/vec3.hpp @@ -28,6 +28,10 @@ class vec3 { vec3 unit() const; + static vec3 random(); + + static vec3 random(double min, double max); + double x, y, z; }; @@ -47,6 +51,12 @@ vec3 operator/(vec3 u, double scale); std::ostream& operator<<(std::ostream& out, vec3 vec); +vec3 random_in_unit_sphere(); + +vec3 random_unit_vector(); + +vec3 random_in_hemisphere(const vec3& normal); + using point3 = vec3; using color = vec3; |
