Created
January 21, 2019 05:17
-
-
Save MacTuitui/dcde414c1d5da4a18837e062065b53ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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