|
Post by PeterMaria on Jul 18, 2015 10:10:56 GMT -5
Hi,
Sub Init2D(width,height) glMatrixMode (GL_PROJECTION) glLoadIdentity() glOrtho(0,width,height,0,-1,1) glMatrixMode (GL_MODELVIEW) glDisable(GL_DEPTH_TEST) End Sub
Sub FillCircle(x#,y#,r1#) dim t# glBegin(GL_TRIANGLE_FAN) glVertex2f(x#, y#) For t#=0 to 360 step 5 glVertex2f(x#+sin(t#)*r1#, y#+cos(t#)*r1#) Next glEnd() End Sub
dim x1#:x1#=200 dim y1#:y1#=200 dim i#, a#,x2#,y2#
Init2D(640,480) glEnable(GL_SMOOTH) while scankeydown(27)=0 glClearColor(0,0,0,1) glClear(GL_COLOR_BUFFER_BIT) for i#=4 to 200 x2# = x1# + cos(i#+a#)*i#*6 y2# = y1# + sin(i#+a#)*i#*6 glColor3ub(200, 200, 255) fillcircle(80+x2#,y2#,i#) next
a# = a#+1 if a#=360 then a#=-a#: end if
swapbuffers() waittimer(20) wend
|
|
|
Post by matthew on Jul 18, 2015 13:00:35 GMT -5
Another program that would make an excellent screensaver, Peter. :-)
|
|