Skip to content

Instantly share code, notes, and snippets.

@MacTuitui
Created January 21, 2019 05:17
Show Gist options
  • Select an option

  • Save MacTuitui/dcde414c1d5da4a18837e062065b53ca to your computer and use it in GitHub Desktop.

Select an option

Save MacTuitui/dcde414c1d5da4a18837e062065b53ca to your computer and use it in GitHub Desktop.
//do a bad polygon
let gfrac = ((app.elapsed_frames() % 300) as f32)/300.0;
let mut points = Vec::new();
let s = 5;
for k in 0..s {
let frac = (k as f32)/(s as f32);
let angle = frac*TAU;
let r = (frac-0.5+gfrac).abs() * 300.0;
points.push(pt2(r*angle.cos(), r*angle.sin()));
}
draw.polygon()
.points(points)
.rgba(1.0, 1.0, 1.0, 0.4);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment