|
![](/i/fill.gif) |
I remember there's such fractal called plasma (bunch of colors
toghether) that is similar to bozo. I want to have the formula of it
I still know that fractint (fractal maker) still exists and if any of
you
are interested, I think I have it somewhere on my site
I tried to make up something that should be quite similar but for some
reason it doesn't work as expected. it is based on changes (visual basic
language)
Dim matrix(32, 32)
Dim y
Dim x
Dim c
Function matrix9(x, y, val)
matrix(x, y) = val
matrix(x + 1, y) = val
matrix(x - 1, y) = val
matrix(x, y + 1) = val
matrix(x, y - 1) = val
matrix(x + 1, y + 1) = val
matrix(x - 1, y + 1) = val
matrix(x + 1, y - 1) = val
matrix(x - 1, y - 1) = val
End Function
Private Sub Command1_Click()
Command3.Enabled = False
Command4.Enabled = False
matrix(1, 1) = Int(Rnd * 2)
For y = 1 To 31
If Int(Rnd * VScroll1.Value) = 0 Then matrix(1, y + 1) =
MyNot(matrix(1, y)) Else matrix(1, y + 1) = matrix(1, y)
Next
For x = 1 To 31
If Int(Rnd * VScroll1.Value) = 0 Then matrix(x + 1, 1) =
MyNot(matrix(x, 1)) Else matrix(x + 1, 1) = matrix(x, 1)
Next
'For x = 2 To 31
' select case matrix(
'For y = 1 To 32
' For x = 1 To 32
' matrix(x, y) = Int(Rnd * 2)
' Next
'Next
'For y = 1 To 31
' For x = 1 To 31
' If matrix(x, y + 1) + matrix(x - 1, y) + matrix(x + 1, y) +
matrix(x, y - 1) < 3 Then matrix(x, y + 1) = 0: matrix(x - 1, y) = 0:
matrix(x + 1, y) = 0: matrix(x, y - 1) = 0 Else a = matrix9(x, y, 1)
' Next
'Next
'the last part of the randomization - displaying the matrix
For y = 1 To 32
For x = 1 To 32
Image2(getindex(x, y)).Picture = Form2.image1(matrix(x, y)).Picture
Next
Next
Command2.Enabled = True
End Sub
Function MyNot(N)
If N = 1 Then N = 0 Else N = 1
MyNot = N
End Function
Function getindex(x, y)
getindex = x + (32 * y) - 32
End Function
Private Sub Command2_Click()
Command3.Enabled = True
Command4.Enabled = True
For y = 2 To 32
For x = 2 To 32
a = matrix(x - 1, y)
b = matrix(y - 1, x)
Select Case a + b
Case 0
If Int(Rnd * 2 * VScroll1.Value) = 1 Then c = MyNot(c)
Case 1
If Int(Rnd * VScroll1.Value) = 1 Then c = MyNot(c)
Case 2
If Int(Rnd * vscroll2.Value * VScroll1.Value) = 1 Then c =
MyNot(c)
End Select
matrix(x, y) = c
Next
' Exit For
Next
For y = 1 To 32
For x = 1 To 32
Image2(getindex(x, y)).Picture = Form2.image1(matrix(x, y)).Picture
Next
Next
End Sub
Private Sub VScroll1_Change()
Label1.Caption = "rnd =" + Str$(VScroll1.Value)
Command1.Enabled = 1
End Sub
Post a reply to this message
|
![](/i/fill.gif) |