• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Showcase Amiga Plasma

Rich

Well-known member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
3rd Party Tool Dev
Joined
Sep 9, 2017
Messages
451
Ive been watching lots of Amiga demos and thought Id try out a plasma effect in CX.
For those that dont know, the Plasma effect was demo'd in late 80s in a PC demo, but the due to the features in Amiga hardware, it became a very popular effect in the early 90s. It uses the diamond square algorithm https://en.wikipedia.org/wiki/Diamond-square_algorithm
 
My old BB code for creating a plasma effect - can't remember what it looks like, probably quite blocky! I've got half a dozen versions and probably as many again written in other languages. Might slap this into CX later see how it looks.

Graphics 640,480,16,1
SetBuffer BackBuffer()
Global r1,r2,ainc
Dim lut(640,480)

For y=0 To 479
For x=0 To 639
If Sin(x+y)>0.1 Then lut(x,y)=1
Next
Next

angle=10
ainc=12
maxcol=64
col_set=1

While Not KeyDown(1)
;Cls
For y=0 To 476 Step 4
For x=0 To 636 Step 4

If lut(x,y) Then

r1 = 20 * Sin( (x)+(angle Shr 3) ) + 40* Sin( (x*2)+(angle Shr 1) ) + 30 * Sin( (x Shr 1) + angle)
r2 = Sin(y+(angle Shr 1)) + 11 * Sin( (y*2)+angle ) + 40 * Sin( y + angle)
col=r1+r2

;don't draw some!
If col >0 And col <maxcol Then
Select col_set
Case 1
Color 0,col,0
Case 2
Color col,0,0
Case 3
Color 0,0,col
End Select
Rect x,y,4,4,1
EndIf
EndIf
Next
Next
Flip

If Rand(50)=1 Then
col_set=Rand(1,3)
EndIf

angle=angle+ainc

Wend
End
 
Back
Top Bottom