An example is the Focusing Triangles Fractal with code included in this post.
'******************************************************************************************
' This program creates a diffuse pattern and focuses it to a crisp, smaller triangle.
' Author: George Ray
'******************************************************************************************
Option Explicit
Dim iGMR, RandNum As Integer
Dim gmrDenom As Double
Dim gmrAx, gmrAy, gmrBx, gmrBy, gmrCx, gmrCy, gmrPx, gmrPy As Double
Sub Main()
gmrDisplay.BackColor = QBColor(0)
gmrDisplay.Show
Call gmrLogo
End Sub
Sub gmrLogo()
gmrAx = 5000 / 4
gmrAy = 3000 / 4
gmrBx = 4000 / 4
gmrBy = 5000 / 4
gmrCx = 6000 / 4
gmrCy = 5000 / 4
gmrPx = 5000 / 4
gmrPy = 4000 / 4
gmrDisplay.PSet (gmrAx, gmrAy), RGB(255, 0, 0)
gmrDisplay.PSet (gmrBx, gmrBy), RGB(255, 0, 0)
gmrDisplay.PSet (gmrCx, gmrCy), RGB(255, 0, 0)
gmrDenom = 1.5
Randomize
For gmrDenom = 1.2 To 2.2 Step 0.4
For iGMR = 1 To 10000
RandNum = Int(3 * Rnd + 1)
If RandNum = 1 Then
gmrPx = (gmrAx + gmrPx) / gmrDenom
gmrPy = (gmrAy + gmrPy) / gmrDenom
gmrDisplay.PSet (gmrPx, gmrPy), RGB(255, 0, 0)
ElseIf RandNum = 2 Then
gmrPx = (gmrBx + gmrPx) / gmrDenom
gmrPy = (gmrBy + gmrPy) / gmrDenom
gmrDisplay.PSet (gmrPx, gmrPy), RGB(0, 255, 0)
ElseIf RandNum = 3 Then
gmrPx = (gmrCx + gmrPx) / gmrDenom
gmrPy = (gmrCy + gmrPy) / gmrDenom
gmrDisplay.PSet (gmrPx, gmrPy), RGB(0, 0, 255)
End If
Next iGMR
Next gmrDenom
End Sub
No comments:
Post a Comment