• Welcome to Dark Bit Factory & Gravity.
 

MATHCOMP Roto Gasket.

Started by Shockwave, November 24, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Shockwave

Here's my first go at the mathcomp challenge.. I wanted to do something with gaskets and I came up with this after a little bit of playing around.
The points are not truely rotating, just the template for the gasket, all points are computed each frame using a bit of Chaos ;)

This uses the DBFGVY Ptc lib (thanks Jim and Rbraz).

Keep watching it, the pattern changes every couple of seconds.


' Gasket Thingy.
' Coded by Shockwave^DBF^S!P.
' For DBF/GVY Math Comp.
'-------------------------------------------------------------------------------

    CONST   XRES = 640:' SCREEN WIDTH
    CONST   YRES = 480:' SCREEN HEIGHT
   
' Thanks Rbraz + jim;   

    #include "ptc.bi"
   
' Set RND Seed;

    RANDOMIZE TIMER
    DIM SHARED AS UINTEGER BUFFER ( XRES * YRES ) :' SCREEN BUFFER
    DIM SHARED GPOINTS AS UINTEGER
    DIM SHARED STP AS DOUBLE
    GPOINTS=9
    DIM SHARED TLAPSE AS DOUBLE
    DIM SHARED AS INTEGER GASKETX(GPOINTS)
    DIM SHARED AS INTEGER GASKETY(GPOINTS)

    DIM SHARED RO AS INTEGER
    DIM SHARED RN AS INTEGER
    DIM SHARED SS AS INTEGER
    DECLARE SUB GENERATE()
    DIM SHARED GADD AS INTEGER

    GENERATE()
   
    PTC_SETFLIP(1) :' SCREEN SYNC ON
   
    ' OPEN THE SCREEN;
   
        IF ( PTC_OPEN ( "(C)DBF/GVY", XRES, YRES ) = 0 ) THEN
        END -1
        END IF
   
    ' MAIN LOOP;
   
    WHILE(1)
        IF TIMER-TLAPSE >= 3 THEN GENERATE()       
        GADD=GADD-1
        IF GADD>360 THEN GADD=GADD-360
    STP=360/GPOINTS
    FOR LP=1 TO GPOINTS
        GASKETX(LP) = 320 + (319*SIN(((LP*STP)+GADD)*3.14/180))
    NEXT
   
    FOR LP=1 TO GPOINTS
        GASKETY(LP) = 240 + (239*COS(((LP*STP)+GADD)*3.14/180))       
    NEXT
   
        FOR SS=1 TO 30000
        WHILE RN=RO
        RN=INT(RND*GPOINTS)+1
        WEND
        RO=RN
            GASKETX(0) = (GASKETX(0)+GASKETX(RN)) SHR 1
            GASKETY(0) = (GASKETY(0)+GASKETY(RN)) SHR 1             
            BUFFER((GASKETX(0)+(GASKETY(0)*XRES))) = &HFFFFFF
        NEXT
        PTC_UPDATE@BUFFER(0)
        ERASE BUFFER
    WEND

SUB GENERATE()
    DIM LP AS INTEGER
    DIM PNM AS INTEGER
    PNM=INT(RND*5)+3       
    GASKETX(0)=GASKETX(1)
    GASKETY(0)=GASKETY(1)
    GPOINTS=PNM
    TLAPSE=TIMER
END SUB

Shockwave ^ Codigos
Challenge Trophies Won:

Rbz

Nice, just need some colors  8)
Challenge Trophies Won:

Shockwave

I'll have to add some :) Cheers Rbraz!
Shockwave ^ Codigos
Challenge Trophies Won:

taj

is it ifs? whatever very nice...
Challenge Trophies Won:

Shockwave

ifs - in full screen?

You should be able to choose windowed or full screen. I'll tart it up a little soon :)
Shockwave ^ Codigos
Challenge Trophies Won:

Ghost^BHT


Shockwave

Did you get more than 1fps Bill? :)
Shockwave ^ Codigos
Challenge Trophies Won:

Ghost^BHT


rdc

Very cool. One of the patterns looks like it has faces in it. :clap:

benny!

Excellent work mate...

Some figures look like snowflakes to me and match perfecly to our season !!! Very well done ...
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Tetra

Nice 1 Shockwave, I like the patterns that looks like a load of tribal faces, although some of the patterns made my eyes go funny :)
Challenge Trophies Won:

mind

pretty :)

and ifs=iterated function system.
Challenge Trophies Won:

MrP

Very nice. I like that....

Shockwave

Thank you :) Glad you like it! Going to try something else tonight.
Shockwave ^ Codigos
Challenge Trophies Won:

lilw4t3rdr0p

I'm not sure it needs color. Maybe some varitations on the white, but not necessarly color. A snow flake....hmm... so this winter storm was your fault! ;)