View difference between Paste ID: tWnN3X0A and r4gvKiBx
SHOW: | | - or go back to the newest paste.
1
#include "fbgfx.bi"
2
3
Dim As Double x, y, angle
4
5
ScreenRes 800, 600, 32,,fb.gfx_alpha_primitives
6
line(0,0)-(800,600),rgb(0,64,128),bf
7-
For angle = 0 To 360 Step 1/8
7+
8-
    x = 16 * (Sin(angle))^3
8+
for S as double = (16*255)/256 to 0 step -1/32
9-
    y = 13 * Cos(angle) - 5 * Cos(2 * angle) - 2 * Cos(3 * angle) - Cos(4 * angle)
9+
  For angle = 0 To 3.1415 Step 1/256
10-
    x = 400 + 10 * x
10+
      
11-
    y = 300 - 10 * y
11+
      x = 16 * (Sin(angle))^3
12-
    
12+
      y = 13 * Cos(angle) - 5 * Cos(2 * angle) - 2 * Cos(3 * angle) - Cos(4 * angle)
13-
    var iX = cint(int(x)), iY=cint(int(y))        
13+
      x = S * x : y = S * y
14-
    var fX = x-iX, fY = y-iY        
14+
      
15-
    pset (iX  , iY  ), RGBA(255, 0, 0, (1-fX)*(1-fY)*255) 
15+
      var iX = cint(int(x)), iY=cint(int(y))        
16-
    pset (iX+1, iY  ), RGBA(255, 0, 0, (  fX)*(1-fY)*255) 
16+
      var fX = x-iX, fY = y-iY        
17-
    pset (iX  , iY+1), RGBA(255, 0, 0, (1-fX)*(  fY)*255) 
17+
      
18-
    pset (iX+1, iY+1), RGBA(255, 0, 0, (  fX)*(  fY)*255)
18+
      'dim as long iG=sqr(x*x+y*y)*.1,iR=128+S*8,iB=64-S*4
19
      dim as long iR=abs(X\2)+128,iB=16+angle*64,iG=abs(Y)*.9
20-
Next angle
20+
      const iAlpha = 128
21
      
22
      pset ((400+iX)  , (300-iY)  ), RGBA(iR, iG, iB, (1-fX)*(1-fY)*iAlpha) 
23
      pset ((400+iX)+1, (300-iY)  ), RGBA(iR, iG, iB, (  fX)*(1-fY)*iAlpha) 
24
      pset ((400+iX)  , (300-iY)-1), RGBA(iR, iG, iB, (1-fX)*(  fY)*iAlpha) 
25
      pset ((400+iX)+1, (300-iY)-1), RGBA(iR, iG, iB, (  fX)*(  fY)*iAlpha)
26
      
27
      pset ((400-iX)  , (300-iY)  ), RGBA(iR, iG, iB, (1-fX)*(1-fY)*iAlpha) 
28
      pset ((400-iX)-1, (300-iY)  ), RGBA(iR, iG, iB, (  fX)*(1-fY)*iAlpha) 
29
      pset ((400-iX)  , (300-iY)-1), RGBA(iR, iG, iB, (1-fX)*(  fY)*iAlpha) 
30
      pset ((400-iX)-1, (300-iY)-1), RGBA(iR, iG, iB, (  fX)*(  fY)*iAlpha)
31
          
32
  Next angle
33
  sleep 30
34
next S
35
36
Sleep
37
End