Post Reply 
Colourful Polygon Explorer
05-20-2021, 01:59 AM
Post: #1
Colourful Polygon Explorer
Use the cursor to play with some polygons, feel free to improve this and play with it:

Code:
EXPORT pOLYcOL()
BEGIN
    LOCAL COORD:={};
    LOCAL COL:={};
  LOCAL J,K,S;

  S:=0;  
  COL(1):=RGB(255,0,0,0);
  COL(2):=RGB(255,255,0,0);
  COL(3):=RGB(0,255,0,0);
  COL(4):=RGB(0,255,255,0);
  COL(5):=RGB(0,0,255,0);
  COL(6):=RGB(255,0,255,0);
  COL(7):=RGB(0,0,0,0);
  J:=60;
  K:=0;
  L:=6;
   REPEAT

  J:=360/L;
RECT_P(0,0,320,240,0);
   FOR T FROM 0 TO 6 DO
      FOR A FROM 0 TO L DO
          COORD(A+1,1):=160-(120-16*T)*Cos(J*A+K);
          COORD(A+1,2):=120-(120-16*T)*Sin(J*A);
      END;
       FILLPOLY_P(G0,COORD,COL(T+1),0);
   END; 
 REPEAT

  IF ISKEYDOWN(7) THEN L:=L-1;S:=1; END;
  IF ISKEYDOWN(8) THEN L:=L+1;S:=1; END;
  IF ISKEYDOWN(2) THEN K:=K-1;S:=1; END;
  IF ISKEYDOWN(12) THEN K:=K+1;S:=1; END;
  IF L<3 THEN L:=3 END;
  IF ISKEYDOWN(4) THEN BREAK(3); END;
  UNTIL S=1;
  S:=0;
UNTIL 0;
END;


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
05-20-2021, 01:52 PM
Post: #2
RE: Colourful Polygon Explorer
I was never able to get a square, just concentric circles.
Find all posts by this user
Quote this message in a reply
05-20-2021, 03:24 PM
Post: #3
RE: Colourful Polygon Explorer
(05-20-2021 01:52 PM)compsystems Wrote:  I was never able to get a square, just concentric circles.

I think it may run too fast, if you push the left button, it will reduce the amount of sides down to a triangle.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)