diff options
author | Julian T <julian@jtle.dk> | 2021-02-08 18:26:27 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-02-08 18:27:00 +0100 |
commit | 7ccc82fc0992fc23aee354d687ce009ae0523bea (patch) | |
tree | 635f7ffe386c638ef8d5ca0db81a3da8ef0f7cc0 /src/sample/mod.rs | |
parent | dbe5f54957ddc13549a6ce822da95170aa09a0c6 (diff) |
Finish depth of field
Diffstat (limited to 'src/sample/mod.rs')
-rw-r--r-- | src/sample/mod.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sample/mod.rs b/src/sample/mod.rs index 5095501..88e1aa9 100644 --- a/src/sample/mod.rs +++ b/src/sample/mod.rs @@ -29,4 +29,16 @@ pub trait Sampler { costheta, ) } + + fn get_in_circle(&mut self) -> Vector2f { + let s2d = self.get_sample_2d(); + + let d = s2d.x.sqrt(); + let theta = s2d.y * 2.0 * M_PI; + + Vector2f::new_xy( + d * theta.cos(), + d * theta.sin(), + ) + } } |