SuperShapes

Post your FreeBASIC tips and tricks here. Please don’t post your code without including an explanation.
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

SuperShapes

Postby duke4e » Jul 30, 2009 22:07

The supershape equation is an extension of the both the equation of the sphere and ellipse
(x / a)^2 + (y / b)^2 = r^2


Main Code

Code: Select all

#include once "FBGfx.bi"
#include once "MouseObject.bi"
Using FB
Const xres = 800
Const yres = 600
Const midx = xres / 2
Const midy = yres / 2
Const As Single TwoPi = Atn(1.0f) * 8.0f

Screenres xres, yres, 32
Dim Shared As MouseObject Mouse


Function Overlap(x0 As Integer, y0 As Integer, w0 As Integer, h0 As Integer, cx As Integer, cy As Integer) As Integer
   Dim As Integer testX = cX
   Dim As Integer testY = cY
   
   If TestX < x0 Then TestX = x0
   If TestX > (x0 + w0) Then TestX = (x0 + w0)
   If TestY < y0 Then Testy = y0
   If TestY > (y0 + h0) Then Testy = (y0 + h0)
   
   If ((cX - TestX) * (cX - TestX) + (cY - TestY) * (cY - TestY)) < 1 Then Return True Else Return False
End Function

Function TextWidth(text As String) As Integer
    Return Len(text) * 8
End Function

Function TextHeight(text As String) As Integer
    Return 8
End Function

Type TSlider
    x As Single
    y As Single
    w As Single
    h As Single
    minvalue As Single
    maxvalue As Single
    text As String
    slidervalue As Single
    returnvalue As Single
    mode As Integer = 1
    retInt As Integer
   
    Declare Sub Make(x As Single, y As Single, w As Single, h As Single, minvalue As Single, maxvalue As Single, text As String, defaultvalue As Single, returnInt As Integer)
    Declare Function Update() As Single
End Type

Sub TSlider.Make(x As Single, y As Single, w As Single, h As Single, minvalue As Single, maxvalue As Single, text As String, defaultvalue As Single, returnInt As Integer = 0)
    this.x = x
    this.y = y
    this.w = w
    this.h = h
    this.minvalue = minvalue
    this.maxvalue = maxvalue
    this.text = text
    this.returnvalue = defaultvalue
    this.returnvalue = defaultvalue
    this.retInt = returnInt
   
    this.slidervalue = (this.w * (this.returnvalue - this.minvalue)) / (this.maxvalue - this.minvalue)
End Sub

Function TSlider.Update() As Single
    Static As Integer staticmy
   
    If (Mouse.Hold(SC_LBUTTON) = False And Mouse.Hold(SC_RBUTTON) = False) Then staticmy = Mouse.GetY
   
    If Mouse.Hold(SC_LBUTTON) Or Mouse.Hold(SC_RBUTTON) Then
        If Overlap(this.x - 10, this.y + 10, this.w + 20, this.h - 10, Mouse.GetX, staticmy) Then
            If Mouse.Hold(SC_LBUTTON) Then this.mode = 1
            If Mouse.Hold(SC_RBUTTON) Then this.mode = 2
            this.slidervalue = Mouse.GetX - this.x
        End If
    End If
   
    If this.slidervalue < 0 Then this.slidervalue = 0
    If this.slidervalue > this.w Then this.slidervalue = this.w
   
   
    Line(this.x - 1, this.y + 9)-(this.x + this.w + 1, this.y + this.h + 1),, b
   
    If this.mode = 1 Then
        this.returnvalue = ((this.slidervalue / this.w) * (this.maxvalue - this.minvalue)) + this.minvalue
        If this.retInt = 1 Then this.returnvalue = Int(this.returnvalue)
        Draw String (this.x, this.y), this.text & ": " & this.returnvalue
        Line(this.x, this.y + 10)-(this.x + this.slidervalue, this.y + this.h), Rgb(50, 50, 50), bf
        Return this.returnvalue
    Else
        this.returnvalue = (this.slidervalue / this.w)
        Draw String (this.x, this.y), this.text & ": " & this.returnvalue & " (1 / " & Int(1 / this.returnvalue) & ")"
        Line(this.x, this.y + 10)-(this.x + this.slidervalue, this.y + this.h), Rgb(150, 50, 50), bf
        Return this.returnvalue
    End If
   
End Function



Sub Eval(m As Single, n1 As Single, n2 As Single, n3 As Single, phi As Single, a As Single, b As Single, Byref x As Single, Byref y As Single, radius As Single)
    Dim As Single mPhi = (m * phi) / 4.0f
    Dim As Single t1 = Cos(mPhi) / a
    Dim As Single t2 = Sin(mPhi) / b
   
    t1 = Abs(t1) ^ n2
    t2 = Abs(t2) ^ n3
   
    Dim As Single r = (t1 + t2) ^ (1 / n1)
    If Abs(r) = 0 Then
        x = 0
        y = 0
    Else
        r = (1 / r) * radius
        x = r * Cos(phi)
        y = r * Sin(phi)
    End If
End Sub

Dim As Single val_m = 1, val_n1 = 10.5, val_n2 = 10.5, val_n3 = 10.5, val_a = 1, val_b = 1, val_radius = 64, val_pointNum = 50
Dim As Tslider gui_m, gui_n1, gui_n2, gui_n3, gui_a, gui_b, gui_radius, gui_pointNum

gui_m.Make             (10, 10 + (30 * 0), 200, 20, 0, 20, "m", val_m, 1)
gui_n1.Make            (10, 10 + (30 * 1), 200, 20, 0, 60, "n1", val_n1, 1)
gui_n2.Make            (10, 10 + (30 * 2), 200, 20, 0, 60, "n2", val_n2, 1)
gui_n3.Make            (10, 10 + (30 * 3), 200, 20, 0, 60, "n3", val_n3, 1)
gui_a.Make             (10, 10 + (30 * 4), 200, 20, 0, 2, "a", val_a, 0)
gui_b.Make             (10, 10 + (30 * 5), 200, 20, 0, 2, "b", val_b, 0)
gui_radius.Make        (10, 10 + (30 * 6), 200, 20, 10, 300, "Radius", val_radius, 1)
gui_pointNum.Make      (10, 10 + (30 * 7), 200, 20, 1, 256, "Point Num", val_pointNum, 1)
Do
    Mouse.Update
   
   
    Screenlock
    Cls
   
    val_m = gui_m.Update
    val_n1 = gui_n1.Update
    val_n2 = gui_n2.Update
    val_n3 = gui_n3.Update
    val_a = gui_a.Update
    val_b = gui_b.Update
    val_radius = gui_radius.Update
    val_pointNum = gui_pointNum.Update
   
    Dim As Single xArray(val_pointNum + 1)
    Dim As Single yArray(val_pointNum + 1)
   
    For i As Integer = 0 To val_pointNum
        Dim As Single phi = i * (TwoPi / val_pointNum)
        Eval(val_m, val_n1, val_n2, val_n3, phi, val_a, val_b, xArray(i), yArray(i), val_radius)
        xArray(i) += midx
        yArray(i) += midy
    Next
   
    For i As Integer = 0 To val_pointNum - 1
        Line(xArray(i), yArray(i))-(xArray(i + 1), yArray(i + 1))
    Next
   
    Screenunlock
   
    Sleep 1
Loop Until Multikey(SC_ESCAPE)


MouseObject.bi

Code: Select all

#ifndef False
#define False 0
#endif

#ifndef True
#define True NOT False
#endif

#if __FB_LANG__ = "fb"
Namespace FB
    #Endif
    Const As Integer SC_LBUTTON = 1
    Const As Integer SC_RBUTTON = 2
    Const As Integer SC_MBUTTON = 4
    #If __FB_LANG__ = "fb"
End Namespace
#endif


Type MouseObject
    x As Integer
    y As Integer
    z As Integer
    buttons As Integer
    scroll As Integer
   
    old_x As Integer
    old_y As Integer
    old_z As Integer
    old_buttons As Integer
    Declare Function Pressed(procInput As Integer) As Integer
    Declare Function Released(procInput As Integer) As Integer
    Declare Function Hold(procInput As Integer) As Integer
    Declare Function DeltaX() As Integer
    Declare Function DeltaY() As Integer
    Declare Function GetX() As Integer
    Declare Function GetY() As Integer
    Declare Function GetScroll() As Integer
    Declare Function GetScrollClamped(mMin As Integer, mMax As Integer) As Integer
    Declare Function GetScrollWrapped(mMin As Integer, mMax As Integer) As Integer
    Declare Function GetAngle() As Single
    Declare Function GetAngleFrom(inpX As Integer, inpY As Integer) As Single
    Declare Sub SetPosition(inpX As Integer, inpY As Integer)
    Declare Sub SetClip(mybool As Integer)
    Declare Sub SetVisible(mybool As Integer)
    Declare Sub Move(inpX As Integer, inpY As Integer)
    Declare Sub Update()
End Type


Sub MouseObject.Update()
    this.old_buttons = this.buttons
    this.old_x = this.x
    this.old_y = this.y
    this.old_z = this.z
   
    Getmouse this.x, this.y, this.z, this.buttons
   
    If this.x = -1 And this.y = -1 And this.buttons = -1 And this.z = -1 Then
        this.buttons = this.old_buttons
        this.x = this.old_x
        this.y = this.old_y
        this.z = this.old_z
    End If
    this.scroll = this.z
End Sub

Function MouseObject.Pressed(procInput As Integer) As Integer
    If (this.buttons And procInput) And Not(this.old_buttons And procInput) Then Return True
    Return False
End Function

Function MouseObject.Released(procInput As Integer) As Integer
    If Not(this.buttons And procInput) And (this.old_buttons And procInput) Then Return True
    Return False
End Function

Function MouseObject.Hold(procInput As Integer) As Integer
    If (this.buttons And procInput) And (this.old_buttons And procInput) Then Return True
    Return False
End Function

Function MouseObject.DeltaX() As Integer
    Return this.x - this.old_x
End Function

Function MouseObject.DeltaY() As Integer
    Return this.y - this.old_y
End Function

Function MouseObject.GetX() As Integer
    Return this.x
End Function

Function MouseObject.GetY() As Integer
    Return this.y
End Function

Function MouseObject.GetScroll() As Integer
    Return this.scroll
End Function

Function MouseObject.GetScrollClamped(mMin As Integer, mMax As Integer) As Integer
    Dim As Integer toReturn = this.scroll
   
    If mMin > mMax Then Swap mMin, mMax
    If toReturn < mMin Then
        Return mMin
    Elseif toReturn > mMax Then
        Return mMax
    End If
   
    Return toReturn
End Function

Function MouseObject.GetScrollWrapped(mMin As Integer, mMax As Integer) As Integer
    If mMin > mMax Then Swap mMin, mMax
   
    Dim As Integer toReturn = this.scroll
    Dim As Integer diff = (mMax - mMin) + 1
   
    If toReturn > mMax Then
        While toReturn > mMax
            toReturn -= diff
        Wend
    Elseif toReturn < mMin Then
        While toReturn < mMin
            toReturn += diff
        Wend
    End If
   
    Return toReturn
End Function

Function MouseObject.GetAngle() As Single
    Dim As Single dx = this.x - this.old_x
    Dim As Single dy = this.y - this.old_y
    Return Atan2(dy, dx)
End Function

Function MouseObject.GetAngleFrom(inpX As Integer, inpY As Integer) As Single
    Dim As Single dx = this.x - inpX
    Dim As Single dy = this.y - inpY
    Return Atan2(dy, dx)
End Function

Sub MouseObject.Move(inpX As Integer, inpY As Integer)
    Setmouse this.x + inpX, this.y + inpY
End Sub

Sub MouseObject.SetPosition(inpX As Integer, inpY As Integer)
    Setmouse inpX, inpY
End Sub

Sub MouseObject.SetClip(mybool As Integer)
    If mybool = True Then Setmouse ,,, 1 Else Setmouse ,,, 0
End Sub

Sub MouseObject.SetVisible(mybool As Integer)
    If mybool = True Then Setmouse ,, 1 Else Setmouse ,, 0
End Sub


Some superformula samples: (a=b=1; m, n1, n2 and n3 are shown in pictures)
Image
Image
Hezad
Posts: 469
Joined: Dec 17, 2006 23:37
Contact:

Postby Hezad » Jul 30, 2009 22:58

Neat ! Thanks for the code, it'll definitely give some ideas :)
agamemnus
Posts: 1842
Joined: Jun 02, 2005 4:48

Postby agamemnus » Jul 31, 2009 2:37

Qool.
1000101
Posts: 2556
Joined: Jun 13, 2005 23:14
Location: SK, Canada

Postby 1000101 » Jul 31, 2009 3:20

This is quite a neat litte bit of code. I incorportated a list of those shapes into your code and gave it a slider to select the shape itself. The number of points needs to be adjusted for a lot of the shapes though.

Code: Select all

#include once "FBGfx.bi"
#include once "MouseObject.bi"
Using FB
Const xres = 800
Const yres = 600
Const midx = xres / 2
Const midy = yres / 2
Const As Single TwoPi = Atn(1.0f) * 8.0f

Screenres xres, yres, 32
Dim Shared As MouseObject Mouse


Function Overlap(x0 As Integer, y0 As Integer, w0 As Integer, h0 As Integer, cx As Integer, cy As Integer) As Integer
        Dim As Integer testX = cX
        Dim As Integer testY = cY
       
        If TestX < x0 Then TestX = x0
        If TestX > (x0 + w0) Then TestX = (x0 + w0)
        If TestY < y0 Then Testy = y0
        If TestY > (y0 + h0) Then Testy = (y0 + h0)
       
        If ((cX - TestX) * (cX - TestX) + (cY - TestY) * (cY - TestY)) < 1 Then Return True Else Return False
End Function

Function TextWidth(text As String) As Integer
    Return Len(text) * 8
End Function

Function TextHeight(text As String) As Integer
    Return 8
End Function

Type TShape
    m As Single
    n1 As Single
    n2 As Single
    n3 As Single
    p As Integer
End Type


Type TSlider
    x As Single
    y As Single
    w As Single
    h As Single
    minvalue As Single
    maxvalue As Single
    text As String
    slidervalue As Single
    returnvalue As Single
    mode As Integer = 1
    retInt As Integer
   
    Declare Sub Make(x As Single, y As Single, w As Single, h As Single, minvalue As Single, maxvalue As Single, text As String, defaultvalue As Single, returnInt As Integer)
    Declare Function Update( newValue As Single = -1.0 ) As Single
End Type

Sub TSlider.Make(x As Single, y As Single, w As Single, h As Single, minvalue As Single, maxvalue As Single, text As String, defaultvalue As Single, returnInt As Integer = 0)
    this.x = x
    this.y = y
    this.w = w
    this.h = h
    this.minvalue = minvalue
    this.maxvalue = maxvalue
    this.text = text
    this.returnvalue = defaultvalue
    this.returnvalue = defaultvalue
    this.retInt = returnInt
   
    this.slidervalue = (this.w * (this.returnvalue - this.minvalue)) / (this.maxvalue - this.minvalue)
End Sub

Function TSlider.Update( newValue As Single = -1.0 ) As Single
    Static As Integer staticmy
   
    If newValue = -1.0 Then
        If (Mouse.Hold(SC_LBUTTON) = False And Mouse.Hold(SC_RBUTTON) = False) Then staticmy = Mouse.GetY
       
        If Mouse.Hold(SC_LBUTTON) Or Mouse.Hold(SC_RBUTTON) Then
            If Overlap(this.x - 10, this.y + 10, this.w + 20, this.h - 10, Mouse.GetX, staticmy) Then
                If Mouse.Hold(SC_LBUTTON) Then this.mode = 1
                If Mouse.Hold(SC_RBUTTON) Then this.mode = 2
                this.slidervalue = Mouse.GetX - this.x
            End If
        End If
    Else
        this.mode = 1
        this.slidervalue = ( newValue * this.w ) / (this.maxvalue - this.minvalue)
    End If
   
    If this.slidervalue < 0 Then this.slidervalue = 0
    If this.slidervalue > this.w Then this.slidervalue = this.w
   
   
    Line(this.x - 1, this.y + 9)-(this.x + this.w + 1, this.y + this.h + 1),, b
   
    If this.mode = 1 Then
        this.returnvalue = ((this.slidervalue / this.w) * (this.maxvalue - this.minvalue)) + this.minvalue
        If this.retInt = 1 Then this.returnvalue = Int(this.returnvalue)
        Draw String (this.x, this.y), this.text & ": " & this.returnvalue
        Line(this.x, this.y + 10)-(this.x + this.slidervalue, this.y + this.h), Rgb(50, 50, 50), bf
        Return this.returnvalue
    Else
        this.returnvalue = (this.slidervalue / this.w)
        Draw String (this.x, this.y), this.text & ": " & this.returnvalue & " (1 / " & Int(1 / this.returnvalue) & ")"
        Line(this.x, this.y + 10)-(this.x + this.slidervalue, this.y + this.h), Rgb(150, 50, 50), bf
        Return this.returnvalue
    End If
   
End Function



Sub Eval(m As Single, n1 As Single, n2 As Single, n3 As Single, phi As Single, a As Single, b As Single, Byref x As Single, Byref y As Single, radius As Single)
    Dim As Single mPhi = (m * phi) / 4.0f
    Dim As Single t1 = Cos(mPhi) / a
    Dim As Single t2 = Sin(mPhi) / b
   
    t1 = Abs(t1) ^ n2
    t2 = Abs(t2) ^ n3
   
    Dim As Single r = (t1 + t2) ^ (1 / n1)
    If Abs(r) = 0 Then
        x = 0
        y = 0
    Else
        r = (1 / r) * radius
        x = r * Cos(phi)
        y = r * Sin(phi)
    End If
End Sub

Dim As Single val_m = 1, val_n1 = 10.5, val_n2 = 10.5, val_n3 = 10.5, val_a = 1, val_b = 1, val_radius = 64, val_pointNum = 50
Dim As Tslider gui_m, gui_n1, gui_n2, gui_n3, gui_a, gui_b, gui_radius, gui_pointNum, gui_shape

Dim As TShape   Shapes( 0 To ... ) = _
        {       _
                (       1.0,      10.5,      10.5,      10.5,      64 ), _
                (       3.0,       4.5,      10.0,      10.0,      64 ), _
                (       4.0,      12.0,      15.0,      15.0,      64 ), _
                (       7.0,      10.0,       6.0,       6.0,      64 ), _
                (       5.0,       4.0,       4.0,       4.0,      64 ), _
                (       5.0,       2.0,       7.0,       7.0,      64 ), _
                (       5.0,       2.0,      13.0,      13.0,      64 ), _
                (       4.0,       1.0,       1.0,       1.0,      64 ), _
                (       4.0,       1.0,       7.0,       8.0,      64 ), _
                (       6.0,       1.0,       7.0,       8.0,      64 ), _
                (       2.0,       2.0,       2.0,       2.0,      64 ), _
                (       1.0,       0.5,       0.5,       0.5,      64 ), _
                (       2.0,       0.5,       0.5,       0.5,      64 ), _
                (       3.0,       0.5,       0.5,       0.5,      64 ), _
                (       5.0,       1.0,       1.0,       1.0,      64 ), _
                (       2.0,       1.0,       1.0,       1.0,      64 ), _
                (       7.0,       3.0,       4.0,      17.0,      64 ), _
                (       2.0,       1.0,       4.0,       8.0,      64 ), _
                (       6.0,       1.0,       4.0,       8.0,      64 ), _
                (       7.0,       2.0,       8.0,       4.0,      64 ), _
                (       4.0,       0.5,       0.5,       4.0,      64 ), _
                (       8.0,       0.5,       0.5,       8.0,      64 ), _
                (      16.0,       0.5,       0.5,      16.0,      64 ), _
                (       3.0,      30.0,      15.0,      15.0,      64 ), _
                (       4.0,      30.0,      15.0,      15.0,      64 ), _
                (       3.0,       5.0,      18.0,      18.0,      64 ), _
                (       6.0,      20.0,       7.0,      18.0,      64 ), _
                (       4.0,       2.0,       4.0,      13.0,      64 ), _
                (       7.0,       3.0,       4.0,      17.0,      64 ), _
                (       7.0,       3.0,       6.0,       6.0,      64 ), _
                (       3.0,       3.0,      14.0,       2.0,      64 ), _
                (      19.0,       9.0,      14.0,      11.0,      64 ), _
                (      12.0,      15.0,      20.0,       3.0,      64 ), _
                (       8.0,       1.0,       1.0,       8.0,      64 ), _
                (       8.0,       1.0,       5.0,       8.0,      64 ), _
                (       8.0,       3.0,       4.0,       3.0,      64 ), _
                (       8.0,       7.0,       8.0,       2.0,      64 ), _
                (       5.0,       2.0,       6.0,       6.0,      64 ), _
                (       6.0,       1.0,       1.0,       6.0,      64 ), _
                (       6.0,       1.0,       7.0,       8.0,      64 ), _
                (       7.0,       2.0,       8.0,       4.0,      64 ), _
                (       3.0,       2.0,       8.0,       3.0,      64 ), _
                (       3.0,       6.0,       6.0,       6.0,      64 ), _
                (       4.0,       1.0,       7.0,       8.0,      64 ), _
                (       4.0,       4.0,       7.0,       7.0,      64 ), _
                (       2.0,       2.0,       2.0,       2.0,      64 ), _
                (       2.0,       1.0,       1.0,       1.0,      64 ), _
                (       2.0,       1.0,       4.0,       8.0,      64 ), _
                (       3.0,       2.0,       5.0,       7.0,      64 ), _
                (       6.0,       2.0,       2.0,       6.0,      64 ), _
                (      25.0,       1.0,       2.0,       4.0,      44 ), _
                (       0.0,       0.0,       0.0,       0.0,       0 )  _
        }
Dim As Integer  mShapes                 = UBound( Shapes ) - 1
Dim As Integer  cShape                  = 0
Dim As Integer  lShape                  = -1

gui_m.Make              ( 10, 10 + ( 30 * 0 ), 200, 20,  0,      20, "m"        , Shapes( mShapes ).m , 0 )
gui_n1.Make             ( 10, 10 + ( 30 * 1 ), 200, 20,  0,      60, "n1"       , Shapes( mShapes ).n1, 0 )
gui_n2.Make             ( 10, 10 + ( 30 * 2 ), 200, 20,  0,      60, "n2"       , Shapes( mShapes ).n2, 0 )
gui_n3.Make             ( 10, 10 + ( 30 * 3 ), 200, 20,  0,      60, "n3"       , Shapes( mShapes ).n3, 0 )
gui_a.Make              ( 10, 10 + ( 30 * 4 ), 200, 20,  0,       2, "a"        , val_a               , 0 )
gui_b.Make              ( 10, 10 + ( 30 * 5 ), 200, 20,  0,       2, "b"        , val_b               , 0 )
gui_radius.Make         ( 10, 10 + ( 30 * 6 ), 200, 20,  5,     300, "Radius"   , val_radius          , 1 )
gui_pointNum.Make       ( 10, 10 + ( 30 * 7 ), 200, 20,  1,     256, "Point Num", Shapes( mShapes ).p , 1 )
gui_Shape.Make          ( 10, 10 + ( 30 * 8 ), 200, 20,  0, mShapes, "Shape"    , cShape              , 1 )

Do
    Mouse.Update
   
   
    Screenlock
    Cls
   
    cShape       = gui_Shape.Update
   
    If( cShape = lShape )Then
        val_m        = gui_m.Update
        val_n1       = gui_n1.Update
        val_n2       = gui_n2.Update
        val_n3       = gui_n3.Update
        val_pointNum = gui_pointNum.Update
    Else
        val_m        = gui_m.Update(        Shapes( cShape ).m  )
        val_n1       = gui_n1.Update(       Shapes( cShape ).n1 )
        val_n2       = gui_n2.Update(       Shapes( cShape ).n2 )
        val_n3       = gui_n3.Update(       Shapes( cShape ).n3 )
        val_pointNum = gui_pointNum.Update( Shapes( cShape ).p  - 1 )
        lShape       = cShape
    End If
    val_a        = gui_a.Update
    val_b        = gui_b.Update
    val_radius   = gui_radius.Update
   
    Dim As Single xArray(val_pointNum + 1)
    Dim As Single yArray(val_pointNum + 1)
   
    For i As Integer = 0 To val_pointNum
        Dim As Single phi = i * (TwoPi / val_pointNum)
        Eval(val_m, val_n1, val_n2, val_n3, phi, val_a, val_b, xArray(i), yArray(i), val_radius)
        xArray(i) += midx
        yArray(i) += midy
    Next
   
    For i As Integer = 0 To val_pointNum - 1
        Line(xArray(i), yArray(i))-(xArray(i + 1), yArray(i + 1))
    Next
   
    Screenunlock
   
    Sleep 1
   
   
Loop Until Multikey(SC_ESCAPE)
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Postby duke4e » Jul 31, 2009 3:41

Great addon 1000101! I'll try to google for some more presets.
D.J.Peters
Posts: 8240
Joined: May 28, 2005 3:28
Contact:

Postby D.J.Peters » Jul 31, 2009 13:16

nice algo
with it you can make a good looking Laser Show screensaver.

Joshy
duke4e
Posts: 717
Joined: Dec 04, 2005 0:16
Location: Varazdin, Croatia, Europe
Contact:

Postby duke4e » Jul 31, 2009 19:15

I forgot to mention that thanks to same formula on all shapes, you can easily morph between them. I'll write the morphing code when I'll have some free time.

Return to “Tips and Tricks”

Who is online

Users browsing this forum: No registered users and 8 guests