Dark Bit Factory & Gravity
GENERAL => Challenges & Competitions => Topic started by: Shockwave on November 24, 2006
-
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
-
Nice, just need some colors 8)
-
I'll have to add some :) Cheers Rbraz!
-
is it ifs? whatever very nice...
-
ifs - in full screen?
You should be able to choose windowed or full screen. I'll tart it up a little soon :)
-
very nice :clap:
-
Did you get more than 1fps Bill? :)
-
Nope :(
-
Very cool. One of the patterns looks like it has faces in it. :clap:
-
Excellent work mate...
Some figures look like snowflakes to me and match perfecly to our season !!! Very well done ...
-
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 :)
-
pretty :)
and ifs=iterated function system.
-
Very nice. I like that....
-
Thank you :) Glad you like it! Going to try something else tonight.
-
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! ;)