The following warnings occurred:
Warning [2] Undefined array key "" - Line: 1584 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1584 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(938) : eval()'d code PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php(938) : eval()'d code 6 errorHandler->error_callback
/inc/functions_post.php 938 eval
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(938) : eval()'d code PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php(938) : eval()'d code 11 errorHandler->error_callback
/inc/functions_post.php 938 eval
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "" - Line: 1584 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1584 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(938) : eval()'d code PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php(938) : eval()'d code 6 errorHandler->error_callback
/inc/functions_post.php 938 eval
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(938) : eval()'d code PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php(938) : eval()'d code 11 errorHandler->error_callback
/inc/functions_post.php 938 eval
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "" - Line: 1584 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1584 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Trying to access array offset on value of type null - Line: 1588 - File: inc/functions.php PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions.php 1588 errorHandler->error_callback
/inc/functions_post.php 203 usergroup_displaygroup
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "useravatar" - Line: 6 - File: inc/functions_post.php(938) : eval()'d code PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php(938) : eval()'d code 6 errorHandler->error_callback
/inc/functions_post.php 938 eval
/showthread.php 1118 build_postbit
Warning [2] Undefined array key "userstars" - Line: 11 - File: inc/functions_post.php(938) : eval()'d code PHP 8.0.22 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/functions_post.php(938) : eval()'d code 11 errorHandler->error_callback
/inc/functions_post.php 938 eval
/showthread.php 1118 build_postbit




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Color waves
#1
Code:
'wavy test fcirc.txt for Naalaa 6

' try a translation of a translation
' Wavy with Plasma.bas for QB64 fork (B+=MGA) 2017-05-05
' Wavy with Plasma Treatment.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-03
' from: animated circles started by Admin at SdlBasic 2017-05-03
' I added Plasma treatment and spacebar  changer


'===================================================================

' Instructions: press spacebar for new injection of plasma

'==================================================================

constant:
xmax 800
ymax 600
DPI# 6.283032
PHIDELTA# 0.4188688
PHISTEP# 0.1256606
largeRADIUS# 20.0
SMALL_R# 20.0
DISTANCE# 23.0
W# 800.0
H# 600.0

visible:
cN# = 1.0
pR#
pG#
pB#

hidden:

set window 200, 40, xmax, ymax
set redraw 0
radians
current_phi# = 0.0
_resetPlasma
while 1
    if inkey(1) = 32
        cN# = 1.0
        _resetPlasma
    endif
    current_phi# = current_phi# + PHISTEP#
    x# = 0.0
    while x# <= (W# + largeRADIUS#)
        y# = 0.0
        while y# <= (W# + largeRADIUS#)
            phiIndex# = float#(int(x# + y#) % int(2.0 * W#)) / largeRADIUS#
            phi# = phiIndex# * PHIDELTA# + current_phi#
            xball# = cos(phi#) * largeRADIUS# + x#
            yball# = sin(phi#) * largeRADIUS# + y#
            _changePlasma
            _DrawFilledCircle int(xball#), int(yball#), int(SMALL_R#)
            y# = y# + DISTANCE#
        wend
        x# = x# + DISTANCE#
   wend
   redraw
    wait 100
wend

function rrnd#(x)
    return float#(rnd(10000))/10000.0
endfunc

procedure changePlasma()
    cN# = cN# + 1.0
    set color int(127.0 + 127.0 * sin(pR# * cN#)), int(127.0 + 127.0 * sin(pG# * cN#)), int(127.0 + 127.0 * sin(pB# * cN#))
endproc

procedure resetPlasma()
    pR# = rrnd#(1)         
    pG# = rrnd#(1)
    pB# = rrnd#(1)
endproc

'very fast but  not round specially smaller circles
procedure DrawFilledCircle(x0, y0, radius)
    x = radius
    y = 0
    err = 0
    while x >= y
        x2 = x*2; y2 = y*2
        draw rect x0 - x, y0 + y, x2, 1, true
        draw rect x0 - y, y0 + x, y2, 1, true
        draw rect x0 - x, y0 - y, x2, 1, true
        draw rect x0 - y, y0 - x, y2, 1, true
        y = y + 1
        err = err + 1 + 2*y
        if 2*(err - x) + 1 > 0
            x = x - 1
            err = err + 1 - 2*x
        endif
    wend
endproc
Wow took awhile to get this going.
b = b + geberation
Reply
#2
"Doctor. I'm seeing spots before my eyes!"

Cool.

J
Reply
#3
Hi Rick,

I just tried copy/paste of code from forum and something is causing Naalaa 6 to bug out!

My fan is still running!

Let's try an attachment:

.txt   wavy test fcirc.txt (Size: 2.14 KB / Downloads: 5)

WTF? That's not working either!



Append: Guess I have to run the text file through a filter to see what the forum is adding to the file to screw it up. The file runs fine directly from disk.

(copied / pasted file from Naalaa editor to this forum editor, all tabs or spaces at start of lines ceased to be.)

Heck that doesn't even work!

There are differences in tabs and carriage returns.


Append: try a zip file:

.zip   wavy test fcirc.zip (Size: 1.06 KB / Downloads: 6)

Ah! that works!

A lesson learned: If Naalaa's keywords aren't colored blue in it's editor, then it is not going to compile correctly.
b = b + geberation
Reply
#4
Hi Rick,

Thanks for feedback! For a test, I copy / pasted your rrrcube into Naalaa and everything seems to be working fine.

So what did I do on my end? I ran the wavey file through Notepad++ to clean up the indentations. I did run that file again through Naalaa to make sure it worked and it did but I suspect Notepad++ did something with unseen characters. I compared the files from here and my original using WinMerge and all indentations were flagged yellow (to indicate a difference between files) but all the words were the same.
b = b + geberation
Reply
#5
May I recommend you to use the 'draw ellipse <x>, <y>, <radius_x>, <radius_y>, <filled>' command? It's a bit faster Smile

Copying and pasting worked well here. But I'm stuck on Linux - at the moment I have no Windows computer.

Probably the text gets converted to UTF8 or some other unicode-representation on Windows, and naalaa can only handle ASCII/extended ASCII.

Very nice demo Smile
Reply
#6
Oh ouch! You make 'being stuck on Linux' sound like a bad thing... lol

J

ps: I tried the 'draw ellipse' command and the speed improvement was bit quicker...
Reply
#7
Ah the ellipse command! Yes, the circle is but a special case of that!  Cool

Thanks for tip Marcus.

Hey, Johnno don't worry, I am stuck on Windows.  Big Grin
b = b + geberation
Reply
#8
Ohhhh! Pretty! Very math-y though! Haha. Reading the code made my eyes glaze more than the scintillating colors. lol
Reply
#9
Hi Gloomshroud,

Sorry about the math, I was trying to get going again with Naalaa and picked what I thought should be something easy and be eye candy!

Imagine a grid of points. Imagine a string tied to each point. Imagine a ball swinging around at the end of the string.
Now imagine the swinging balls synchronized so they create a wave pattern down each row, a sine or cosine wave.
Now imagine all the rows of swinging balls, waves, also synchronized.
You get a wavy surface.

I can dig up a cleaner, maybe more understandable coding if you are interested. You would be able to see the points, strings and balls rotating at the end of the strings. It's pretty cool too as you can pattern the colors like pixels in text to produce a wavy message.


Hi Johnno and Marcus,

Today I spent morning testing circle fill routines against Draw Ellipse. On my machine, the code I used for drawing a filled circle in wavy takes about half the time as draw ellipse but the "circles" are more like rounded diamonds. I did find a couple of comparable times to draw ellipse time and one might slightly edge it out in time. It is the gold standard used at QB64 but the difference is so slight it does not justify carrying the extra code.

My test loop ran radii from 255 to 1 varying the color, here is the code with results in comments.

I am interested in what results Linux produces.


.zip   Filled circle tests.zip (Size: 1.66 KB / Downloads: 3)

OK I tested download of zip and it works perfectly. You will have to comment out the one line _QBfcirc and uncomment draw ellipse with true for filled version, to compare times.
b = b + geberation
Reply
#10
Ok. Ran each method several times.

Draw circle avg: 45ms
Draw ellipse avg: 15ms

In both cases the images were produced that fast I could not see it being drawn. Cool.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)