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

Possibly Related Threads…
Thread Author Replies Views Last Post
  Good MacOs Font? BlameTroi 5 957 05-23-2025, 05:31 PM
Last Post: bplus
  What good is cake if you can't eat it too? Pete 2 889 02-21-2025, 04:35 AM
Last Post: Pete
  Good Coding with ElseIF Dimster 12 2,381 05-05-2023, 08:37 PM
Last Post: bplus
  Cannot convert expression type to symbol eoredson 4 1,075 09-26-2022, 04:54 AM
Last Post: mnrvovrfc
  Can't Convert an INT to a String TarotRedhand 4 1,068 05-22-2022, 05:13 PM
Last Post: James D Jarvis

Forum Jump:


Users browsing this thread: 1 Guest(s)