Author Topic: Relaxation  (Read 1440 times)

0 Members and 1 Guest are viewing this topic.

Peter

  • Guest
Relaxation
« on: November 29, 2015, 06:10:06 AM »
Hello,

OpenGl  Relaxation.

Code: [Select]
include "ogl.inc"
window 640,480,1

int a
while key(27)=0
cls 255,255,255

for y=0 to 480 step 40
for x=0 to 640 step 40
    color 0,0,255,255
    fillcircle x+sin(rad(a))*40,y+cos(rad(a))*40,10
    color 255,0,0,255
    fillcircle x+cos(rad(a))*40,y+sin(rad(a))*40,10
    color 0,200,0,255
    fillcircle x+cos(rad(a))*40,y+cos(rad(a))*40,10
next
next

a +=2
if a >=360 then a=-a
redraw
wait 10
wend
winEnd


.

Mike Lobanovsky

  • Guest
Re: Relaxation
« Reply #1 on: November 29, 2015, 08:06:49 AM »
Hi,

Some GDI relaxation to match:

Code: OxygenBasic
  1. ' !!! FBSL BASIC !!!
  2. #Option  Implicit
  3. #Include "mingfx.inc"
  4.  
  5. Width  = 640
  6. Height = 480
  7. a      = 0
  8.  
  9. Window(Width, Height, FALSE, "Epileptic Seizure")
  10.  
  11. Animate
  12.   Screen(255, 255, 255)
  13.   For y = 0 To Height Step 40
  14.     For x = 0 To Width Step 40
  15.       ds = Sin(Rad(a)) * 40
  16.       dc = Cos(Rad(a)) * 40
  17.       Ink(0, 0, 255): FillCircle(x + ds, y + dc, 20)
  18.       Ink(255, 0, 0): FillCircle(x + dc, y + ds, 20)
  19.       Ink(0, 200, 0): FillCircle(x + dc, y + dc, 20)
  20.     Next
  21.   Next
  22.   If Incr(a, 2) > 360 Then a = -a
  23.   Redraw()
  24.   Wait(10)
  25. Forever

.
« Last Edit: November 29, 2015, 08:17:12 AM by Mike Lobanovsky »