Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QBJS deforming torus
#1
inside out torus

run it in QBJS

Code: (Select All)
r = 50
rr = 100
pi = 3.141593

SCREEN _NEWIMAGE(640, 480, 32), , 1, 0

dim t
'SCREEN , , 0, 0
DO
    cls  
    'PCOPY 1, 0
    t = t + .1

    FOR u = 0 TO 7 STEP .05
        FOR v = 0 TO 7 STEP .1

            h = 100 * SIN(t)
            x = (100 + 50 * COS(u)) * COS(v) + h

            rr = 100 * COS(t)
            cc = (pi / 2) * SIN(t)
            ss = SIN(v) * COS(t) + SIN(t)
            y = (rr + r * COS(u + cc)) * ss

            rr = 100 * SIN(t)
            cc = (pi / 2) * COS(t)
            ss = SIN(v) * SIN(t) + COS(t)
            z = (rr + r * COS(u + cc)) * ss

            PSET (x + 0.707 * z + 320, y + 0.707 * z + 240), _RGB(255, 0, z * 10)
        NEXT
    NEXT
    'SLEEP
    _LIMIT 10
    _DISPLAY
LOOP
Reply


Messages In This Thread
QBJS deforming torus - by vince - 04-14-2023, 02:01 AM
RE: QBJS deforming torus - by vince - 04-14-2023, 02:07 AM
RE: QBJS deforming torus - by mnrvovrfc - 04-14-2023, 02:55 AM
RE: QBJS deforming torus - by vince - 04-14-2023, 03:13 AM
RE: QBJS deforming torus - by CharlieJV - 04-14-2023, 03:29 AM



Users browsing this thread: 1 Guest(s)