fn draw_paper_texture(draw: &Draw, _model: &Model, win: &Rect) {
  draw.background().color(hsl(0.15, 0.4, 0.965));
  let fbm = Fbm::new();
  let seed = random_f64();
  let noise_scale = 60.0;
  for _ in 0..=200 {
    let y = win.y.lerp(random_f32());
    let mut x = win.x.lerp(random_f32());
    let points = (0..=200).map(|_| {
      x += 1.;
      let noise = fbm.get([x as f64 / noise_scale, y as f64 / noise_scale, seed]) as f32;
      let y = y + noise * 10.;
      pt2(x, y)
    });
    draw.polyline().color(hsl(0., 0., 0.895)).points(points);
  }
}
// randomly generate short squiggles that are distored by Fbm noise (fractal brownian motion)
randomly generate short squiggles that are distored by Fbm noise (fractal brownian motion)
randomly generate short squiggles that are distored by Fbm noise ( fractal brownian motion )
fn draw_paper_texture(draw: &Draw, _model: &Model, win: &Rect) {
  draw.background().color(hsl(0.15, 0.4, 0.965));
  let fbm = Fbm::new();
  let seed = random_f64();
  let noise_scale = 60.0;
  for _ in 0..=200 {
    let y = win.y.lerp(random_f32());
    let mut x = win.x.lerp(random_f32());
    let points = (0..=200).map(|_| {
      x += 1.;
      let noise = fbm.get([x as f64 / noise_scale, y as f64 / noise_scale, seed]) as f32;
      let y = y + noise * 10.;
      pt2(x, y)
    });
    draw.polyline().color(hsl(0., 0., 0.895)).points(points);
  }
}
fn draw_paper_texture ( draw : & Draw , _model : & Model , win : & Rect ) { draw . background ( ) . color ( hsl ( 0.15 , 0.4 , 0.965 ) ) ; let fbm = Fbm :: new ( ) ; let seed = random_f64 ( ) ; let noise_scale = 60.0 ; for _ in 0 ..= 200 { let y = win . y . lerp ( random_f32 ( ) ) ; let mut x = win . x . lerp ( random_f32 ( ) ) ; let points = ( 0 ..= 200 ) . map ( | _ | { x += 1. ; let noise = fbm . get ( [ x as f64 / noise_scale , y as f64 / noise_scale , seed ] ) as f32 ; let y = y + noise * 10. ; pt2 ( x , y ) } ) ; draw . polyline ( ) . color ( hsl ( 0. , 0. , 0.895 ) ) . points ( points ) ; } }
randomly generate short squiggles that are distored by Fbm noise (fractal brownian motion)
randomly generate short squiggles that are distored by Fbm noise ( fractal brownian motion )
draw
&Draw
_model
&Model
win
&Rect