Guest User

Untitled

a guest
Jan 23rd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. vx = sin(0.8 * f) * (VIDEOX * 0.5) - (VIDEOX * 0.5) + state;
  2. vy = cos(1.2 * f) * (VIDEOY * 0.5) - (VIDEOY * 0.5) + state;
  3.  
  4. /* draw plasma */
  5. for(y = 0; y < VIDEOY; y++)
  6. {
  7. for(x = 0; x < VIDEOX; x++)
  8. {
  9. xx = vx;
  10. xx += x;
  11. xx *= xx;
  12.  
  13. yy = vy;
  14. yy += y;
  15. yy *= yy;
  16.  
  17. c1 = x;
  18. c1 *= 0.02;
  19. c1 += f;
  20. c1 += y;
  21. c1 *= 0.005;
  22. c1 = sin(c1);
  23.  
  24. c2 = xx;
  25. c2 += yy;
  26. c2 = sqrt(c2);
  27. c2 *= 0.02;
  28. c2 = sin(c2);
  29.  
  30. c3 = c1;
  31. c3 += c2;
  32. c3 *= 0.5;
  33. c3 += 1;
  34. c3 *= 127;
  35.  
  36. res = ceil(c3);
  37.  
  38. ppixel(screen, x, y, r[res], g[res], b[res]);
  39. }
  40. }
Add Comment
Please, Sign In to add comment