Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
anyone good at javascript want to help convert a cool animation to QB64PE?
#9
Here is a one-shot attempt by my personally trained model on NotebookLM. Code works perfectly with zero edits. There is a nice, smooth transition between colors.
Prompt:
Quote:Make some plasma animation code

   

Code: (Select All)
Screen _NewImage(640, 480, 32) ' Set up a 640x480 32-bit screen
_Display ' Turn off auto-display

Dim x As Single, y As Single, Time As Single ' Variables for position and time
Dim r As Integer, g As Integer, b As Integer ' Variables for color components

Time = 0 ' Initialize time

Do ' Start the main animation loop
    _Limit 60 ' Limit to 60 frames per second
    Cls ' Clear the screen for the new frame
    Time = Time + 0.05 ' Increment time for animation effect

    For y = 0 To 479 ' Loop through rows
        For x = 0 To 639 ' Loop through columns

            ' Calculate plasma color using sine waves based on position and time
            ' Scale and offset sine results (-1 to 1) to range 0-255 for RGB
            r = CInt(((Sin((x + Time) * .03) + Sin((y + Time) * .05)) + 2) * 63.75) ' Red component
            g = CInt(((Sin((x + Time) * .05) + Sin((y + Time) * .03)) + 2) * 63.75) ' Green component
            b = CInt(((Sin((x + y + Time) * .04) + Sin(Sqr(x * x + y * y) * .02 + Time)) + 2) * 63.75) ' Blue component using combined pos and distance

            ' Draw the pixel with the calculated color
            PSet (x, y), _RGB32(r, g, b)

        Next x
    Next y

    _Display ' Show the completed frame on the screen

Loop Until Len(InKey$) <> 0 ' Loop until a key is pressed

End ' End the program
The noticing will continue
Reply


Messages In This Thread
RE: anyone good at javascript want to help convert a cool animation to QB64PE? - by SpriggsySpriggs - 05-21-2025, 04:18 PM



Users browsing this thread: 1 Guest(s)