Guest User

Untitled

a guest
Feb 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <input id="spin"> <label for="spin">
  2.  
  3. input#spin:hover + div.spin { }
  4.  
  5. input#spin {
  6. width: 0;
  7. height: 0;
  8. border: none;
  9. position: absolute;
  10. }
  11.  
  12. vec3 paintCircle (vec2 uv, vec2 center, float rad, float width) {
  13.  
  14. // координаты пикселя относительно центра "круга"
  15. vec2 diff = center - uv;
  16.  
  17. // расстояние до этой точки
  18. float len = length(diff);
  19.  
  20. // расстояние до "круга"
  21. float circle = smoothstep(rad - width, rad, len) -
  22. smoothstep(rad, rad + width, len);
  23.  
  24. // поворот текстурных координат относительно центра "круга"
  25. vec2 at = atan(uv-center) * rotate2d(rotation);
  26.  
  27. // вырезание 2 частей окружности
  28. if (at.x - 0.05 < 0. && at.x + 0.05 > 0.)
  29. circle -= 1.0;
  30.  
  31. return vec3(circle);
  32. }
Add Comment
Please, Sign In to add comment