Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. float shape(vec2 p, int N, float size){
  2. p = p * 2. - 1.;
  3.  
  4. float a = atan(p.x, p.y) + PI;
  5. float r = TWO_PI / float(N);
  6. float l = length(p);
  7.  
  8. float d = cos(floor(.5 + a / r) * r - a) * l;
  9.  
  10. return step(size, d);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement