3D Cube Galileo

PROG Balls in 3D cube galileo.bas bpf 2015-05-16
Classic animation program modified for fun
Galileo, 02/2018
Powered by Yabasic
http://retrogamecoding.org/board/index.php?topic=635.0
https://github.com/marcIhm/yabasic
http://www.yabasic.de/


    rem // PROG Balls in 3D cube galileo.bas bpf 2015-05-16
    rem // Classic animation program  modified for fun
    rem // Galileo, 02/2018
    rem // Powered by Yabasic
    rem // http://retrogamecoding.org/board/index.php?topic=635.0
    rem // https://github.com/marcIhm/yabasic

    clear screen
    open window 500, 500
    backcolor 0, 0, 0
    clear window
    color 200, 200, 0
    pozx = 0
    pozy = 0

    do
        rysuj()
        wait 0.03
        pozx = pozx + 2
        pozy = pozy + 2
        rem // clear window
    loop

    sub rysuj()
        a = pozx / 99
        b = pozy / 99
        for x = -1 to 1
            for y = -1 to 1
                for z = -1 to 1
                    y2 = y
                    x2 = x * cos(a) - y2 * sin(a)
                    y3 = x * sin(a) + y2 * cos(a)
                    y2 = y3
                    y3 = y2 * cos(b) - z * sin(b)
                    z2 = y2 * sin(b) + z * cos(b)
                    sx = 250 + x2 * (z2 + 2) * 35
                    sy = 250 + y3 * (z2 + 2) * 35
                    size = (z2 + 2) * 5 : colorin = size * 8
                    color colorin, colorin, colorin
                    fill circle sx, sy, size

                    INK(colorin, 128 + colorin/128, 128-.5*colorin, 255)
                    CIRCLE(sx, sy, size, size, TRUE)
                next z
            next y
        next x
    end sub