peter
11-04-2014, 12:04
Hi,
Is a little bit slow, but funny.
Uses "ui"
#INCLUDE "abc.inc"
OpenWindow 320, 320
SetHandleDC hdc, hwnd
Sub Trauma(im,ii,st As Single)
Local fx, fy, i As Single
Local r, g, b, c, x, y As Long
For x=0 To 320
i =1
fy=0
For y=0 To 320
c=i*(Cos(fx))+i*(Cos(fy))
r = Get_R(c)
g = Get_G(c)
b = Get_B(c)
Canvas_SetPixel x,320-y,xRgb(r,g,b)
i=i*im+ii
fy +=st
Next
fx +=st
Next
End Sub
Dim m,n As Single
Dim i As Long
While IsWindow(hwnd) And Key(27)=0
m=1 : n=1
For i=1 To 40
Trauma (m,n,.01)
n +=111
Canvas_Redraw
Next
m=1 : n=1
For i=1 To 40
Trauma (m,n,.02)
n +=111
Canvas_Redraw
Next
m=.5 : n=.5
For i=1 To 40
Trauma (m,n,.03)
n +=111
Canvas_Redraw
Next
m=1 : n=1
For i=1 To 40
Trauma (m,n,.04)
n +=111
Canvas_Redraw
Next
Wend
Canvas_Window End hwnd
ps: small correction, xRgb instead of rgb.
Is a little bit slow, but funny.
Uses "ui"
#INCLUDE "abc.inc"
OpenWindow 320, 320
SetHandleDC hdc, hwnd
Sub Trauma(im,ii,st As Single)
Local fx, fy, i As Single
Local r, g, b, c, x, y As Long
For x=0 To 320
i =1
fy=0
For y=0 To 320
c=i*(Cos(fx))+i*(Cos(fy))
r = Get_R(c)
g = Get_G(c)
b = Get_B(c)
Canvas_SetPixel x,320-y,xRgb(r,g,b)
i=i*im+ii
fy +=st
Next
fx +=st
Next
End Sub
Dim m,n As Single
Dim i As Long
While IsWindow(hwnd) And Key(27)=0
m=1 : n=1
For i=1 To 40
Trauma (m,n,.01)
n +=111
Canvas_Redraw
Next
m=1 : n=1
For i=1 To 40
Trauma (m,n,.02)
n +=111
Canvas_Redraw
Next
m=.5 : n=.5
For i=1 To 40
Trauma (m,n,.03)
n +=111
Canvas_Redraw
Next
m=1 : n=1
For i=1 To 40
Trauma (m,n,.04)
n +=111
Canvas_Redraw
Next
Wend
Canvas_Window End hwnd
ps: small correction, xRgb instead of rgb.