Here is tilted ellipsii with some fun coloring:
Hmm... looks like imperfect overlap occasionally.
Update: Overlap problem fixed, I think.
Code: (Select All)
Screen _NewImage(800, 600, 32)
_ScreenMove 250, 50
Dim Shared pR, pG, pB, pA, cN
Do
lc = lc + 1
If lc = 100 Then Cls: lc = 0
resetPlasma
cx = Rnd * _Width: cy = Rnd * _Height: a = Rnd * 100: b = Rnd * 100: ang = _Pi(Rnd * 2)
For i = 0 To 1 Step .0005
EllipseTilt cx, cy, i * a, i * b, ang, Plasma~&
Next
_Limit 30
Loop Until _KeyDown(27)
Function Plasma~& () ' this creates a wonderful sequence of colors cN, pR, pG, pB are Shared
cN = cN + .1 ' might want to keep cN single and increment by .5, .1.. depending on needs
Plasma~& = _RGB32(127 + 127 * Sin(pR * cN), 127 + 127 * Sin(pG * cN), 127 + 127 * Sin(pB * cN), 3)
End Function
Sub resetPlasma ' this sets up to use changePlasma pR, pG, pB are Shared
pR = Rnd ^ 2: pG = Rnd ^ 2: pB = Rnd ^ 2: pA = Rnd * 100: cN = 0
End Sub
'=========================================================================================================== drawing
'thanks STxAxTIC from Toolbox
Sub EllipseTilt (CX, CY, a, b, ang, C As _Unsigned Long)
Dim k, i, j
' CX = center x coordinate
' CY = center y coordinate
' a = semimajor axis major radius
' b = semiminor axis minor radius
' ang = clockwise orientation of semimajor axis in radians (0 default)
' C = fill color
For k = 0 To 6.283185307179586 Step .025 'not sure about the stepper it should depend on a and b
i = a * Cos(k) * Cos(ang) + b * Sin(k) * Sin(ang)
j = -a * Cos(k) * Sin(ang) + b * Sin(k) * Cos(ang)
i = i + CX
j = -j + CY
If k <> 0 Then
Line -(i, j), C
Else
PSet (i, j), C
End If
Next
End Sub
Hmm... looks like imperfect overlap occasionally.
Update: Overlap problem fixed, I think.
b = b + ...